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-44409][SQL] Handle char/varchar in Dataset.to to keep consistent with others #41992

Closed
wants to merge 1 commit into from

Conversation

yaooqinn
Copy link
Member

What changes were proposed in this pull request?

This PR replaces user-specified char/varchar in dataset.to API to make it consistent with other dataset/dataframe APIs

Why are the changes needed?

Currently, INVALID_COLUMN_OR_FIELD_DATA_TYPE is thrown when converting char to char, varchar to varchar.

Does this PR introduce any user-facing change?

yes, different error classes when LEGACY_CHAR_VARCHAR_AS_STRING off and using char/vachar in dataset.to. While LEGACY_CHAR_VARCHAR_AS_STRING on, to is able to handle char/varchar

How was this patch tested?

new tests

@github-actions github-actions bot added the SQL label Jul 14, 2023
@yaooqinn
Copy link
Member Author

cc @cloud-fan who added this new API in 3.4

@yaooqinn yaooqinn requested a review from cloud-fan July 17, 2023 01:34
@yaooqinn yaooqinn closed this in 85d8d62 Jul 17, 2023
@yaooqinn
Copy link
Member Author

thanks @HyukjinKwon , merged to master

ragnarok56 pushed a commit to ragnarok56/spark that referenced this pull request Mar 2, 2024
…nt with others

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

This PR replaces user-specified char/varchar in dataset.to API to make it consistent with other dataset/dataframe APIs

### Why are the changes needed?

Currently, `INVALID_COLUMN_OR_FIELD_DATA_TYPE` is thrown when converting char to char, varchar to varchar.

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

yes, different error classes when LEGACY_CHAR_VARCHAR_AS_STRING off and using char/vachar in `dataset.to`. While LEGACY_CHAR_VARCHAR_AS_STRING on, `to` is able to handle char/varchar

### How was this patch tested?

new tests

Closes apache#41992 from yaooqinn/SPARK-44409.

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
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.

2 participants