-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-51525][SQL] Collation field for Desc As JSON StringType #50290
Conversation
columns = Some(List( | ||
TableColumn("c1", Type("string", collation = Some("UNICODE_CI"))), | ||
TableColumn("c2", Type("string", collation = Some("UNICODE_RTRIM"))), | ||
TableColumn("c3", Type("string", collation = Some("fr"))), |
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.
Curious, why is the case not normalized? For builtin collations they should be, no?
There is still a test failure |
case stringType: StringType => | ||
JObject( | ||
"name" -> JString("string"), | ||
"collation" -> JString(stringType.collationName) |
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.
Is the plan to add a table collation as a top-level field to JSON in a separate PR?
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.
yes I'll make a separate PR to add the top-level table collation field
sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala
Show resolved
Hide resolved
thanks, merging to master/4.0! |
### What changes were proposed in this pull request? Add a collation field for Desc As JSON StringType. For example: ``` "columns":[{"name":"c1","type":{"name":"string", "collation":"UNICODE_CI"} ``` or the default collation value: ``` "columns":[{"name":"c1","type":{"name":"string", "collation":"UTF8_BINARY"} ``` ### Why are the changes needed? Add support for collation data type in Desc As JSON ### Does this PR introduce _any_ user-facing change? Yes, it affects the output of Desc As JSON for collation data type. ### How was this patch tested? Added test in DescribeTableSuite ### Was this patch authored or co-authored using generative AI tooling? No Closes #50290 from asl3/asl3/collation-descasjson. Authored-by: Amanda Liu <amanda.liu@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 513a080) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
What changes were proposed in this pull request?
Add a collation field for Desc As JSON StringType.
For example:
or the default collation value:
Why are the changes needed?
Add support for collation data type in Desc As JSON
Does this PR introduce any user-facing change?
Yes, it affects the output of Desc As JSON for collation data type.
How was this patch tested?
Added test in DescribeTableSuite
Was this patch authored or co-authored using generative AI tooling?
No