-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-52281][SQL] Change ALTER TABLE ALTER COLUMN TYPE STRING
not to apply default collation if original data type was instance of StringType
#51001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ALTER TABLE ALTER COLUMN TYPE STRING
not to apply default collation if original data type was instance of StringType
ALTER TABLE ALTER COLUMN TYPE STRING
not to apply default collation if original data type was instance of StringType
@cloud-fan can you please review? |
sql/core/src/test/scala/org/apache/spark/sql/collation/DefaultCollationTestSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/collation/DefaultCollationTestSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/scala/org/apache/spark/sql/collation/DefaultCollationTestSuite.scala
Show resolved
Hide resolved
...rc/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala
Show resolved
Hide resolved
b40ed07
to
7a39330
Compare
e7e8c33
to
85680fe
Compare
sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala
Outdated
Show resolved
Hide resolved
3e929ec
to
f9081c3
Compare
* Query Example: | ||
* {{{ | ||
* CREATE TABLE t (c1 STRING COLLATE UNICODE) | ||
* ALTER TABLE t ALTER COLUMN c1 TYPE STRING -- c1 will remain STRING COLLATE UNICODE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this behavior come from? It looks a special case where we inherit the collation from the previous column type if it's a string type. How about nested string type in struct type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @srielau
269723e
to
f1cc837
Compare
f1cc837
to
c3dbcd0
Compare
What changes were proposed in this pull request?
Changed
ALTER TABLE ALTER COLUMN TYPE STRING
not to apply default collation if original data type was instance ofStringType
.Why are the changes needed?
Bug fix.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Tests added to
DefaultCollationTestSuite
.Was this patch authored or co-authored using generative AI tooling?
No.