Skip to content
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-51657] UTF8_BINARY default table collation shown by default in Desc As JSON (v1) #50451

Closed
wants to merge 5 commits into from

Conversation

asl3
Copy link
Contributor

@asl3 asl3 commented Mar 28, 2025

What changes were proposed in this pull request?

Display UTF8_BINARY default table collation by default in Desc As JSON for v1 table.

Note this only affects the desc as json output and not desc table extended -- desc table does NOT always show the top-level table collation (if omitted in thedesc table output, it is UTF8_BINARY)

Why are the changes needed?

If the CatalogTable collation property is None, then it is by default UTF8_BINARY. This update is for completeness for the desc as json output.

Does this PR introduce any user-facing change?

Yes, affects the JSON result

How was this patch tested?

Added tests in v1/DescribeTableSuite.scala

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Mar 28, 2025
@gengliangwang
Copy link
Member

FYI there is test failure

[info] - describe.sql *** FAILED *** (429 milliseconds)
[info]   describe.sql
[info]   Expected "...n_columns":["c","d"][]}", but got "...n_columns":["c","d"][,"collation":"UTF8_BINARY"]}" Result did not match for query #7
[info]   DESCRIBE EXTENDED t AS JSON (SQLQueryTestSuite.scala:683)

asl3 added 3 commits March 28, 2025 16:21
@gengliangwang
Copy link
Member

thanks, merging to master

gengliangwang pushed a commit that referenced this pull request Apr 1, 2025
… Desc As JSON (v1)

### What changes were proposed in this pull request?

Display `UTF8_BINARY` default table collation by default in Desc As JSON for v1 table.

Note this only affects the `desc as json` output and not `desc table extended` -- desc table does NOT always show the top-level table collation (if omitted in the`desc table` output, it is `UTF8_BINARY`)

### Why are the changes needed?

If the CatalogTable `collation` property is None, then it is by default `UTF8_BINARY`. This update is for completeness for the `desc as json` output.

### Does this PR introduce _any_ user-facing change?

Yes, affects the JSON result

### How was this patch tested?

Added tests in `v1/DescribeTableSuite.scala`

### Was this patch authored or co-authored using generative AI tooling?

No

Closes #50451 from asl3/asl3/descasjson-defaultcollation.

Authored-by: Amanda Liu <[email protected]>
Signed-off-by: Gengliang Wang <[email protected]>
(cherry picked from commit 13945c8)
Signed-off-by: Gengliang Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants