-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-48413][SQL][FOLLOW-UP] Fix ALTER COLUMN with collation #48582
base: master
Are you sure you want to change the base?
Conversation
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
Outdated
Show resolved
Hide resolved
sql(s"ALTER TABLE $tableName ALTER COLUMN c1 TYPE STRING COLLATE UTF8_LCASE") | ||
sql(s"INSERT INTO $tableName VALUES ('a')") |
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.
sql(s"ALTER TABLE $tableName ALTER COLUMN c1 TYPE STRING COLLATE UTF8_LCASE") | |
sql(s"INSERT INTO $tableName VALUES ('a')") | |
sql(s"INSERT INTO $tableName VALUES ('a')") | |
sql(s"ALTER TABLE $tableName ALTER COLUMN c1 TYPE STRING COLLATE UTF8_LCASE") |
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.
Let's first insert and then alter, seems a bit nicer for the test.
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.
Please explain you change a bit more in the PR description
@@ -516,6 +516,16 @@ class CollationSuite extends DatasourceV2SQLBase with AdaptiveSparkPlanHelper { | |||
} | |||
} | |||
|
|||
test("SPARK-48413: Alter column with collation") { |
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.
can we also add tests for complex types (struct, map, array)?
What changes were proposed in this pull request?
Fixing the analysis check error introduced in PR.
Why are the changes needed?
Change is needed to enable altering column with all datasources and identifier variations.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Added tests to
CollationSuite
.Was this patch authored or co-authored using generative AI tooling?
No.