[SPARK-42904][SQL] Char/Varchar Support for JDBC Catalog#40531
Closed
yaooqinn wants to merge 1 commit into
Closed
Conversation
Member
Author
|
cc @HyukjinKwon @cloud-fan @dongjoon-hyun thanks |
LuciferYang
reviewed
Mar 24, 2023
| sql("CREATE TABLE h2.test.new_table(c CHAR(1000000001))") | ||
| } | ||
| assert(e.getCause.getMessage.contains("1000000001")) | ||
| } |
Contributor
There was a problem hiding this comment.
should we also add a VARCHAR case? like
sql("CREATE TABLE h2.test.new_table(c VARCHAR(1000000001))")
?
Member
Author
There was a problem hiding this comment.
Not really necessary, as we don't classify the exception on our side
LuciferYang
approved these changes
Mar 24, 2023
cloud-fan
approved these changes
Mar 24, 2023
yaooqinn
added a commit
that referenced
this pull request
Mar 24, 2023
### What changes were proposed in this pull request? Add type mapping for spark char/varchar to jdbc types. ### Why are the changes needed? The STANDARD JDBC 1.0 and other modern databases define char/varchar normatively. This is currently a kind of bug for DDLs on JDBCCatalogs for encountering errors like ``` Cause: org.apache.spark.SparkIllegalArgumentException: Can't get JDBC type for varchar(10). [info] at org.apache.spark.sql.errors.QueryExecutionErrors$.cannotGetJdbcTypeError(QueryExecutionErrors.scala:1005) ``` ### Does this PR introduce _any_ user-facing change? yes, char/varchar are allow for jdbc catalogs ### How was this patch tested? new ut Closes #40531 from yaooqinn/SPARK-42904. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Kent Yao <yao@apache.org> (cherry picked from commit 18cd801) Signed-off-by: Kent Yao <yao@apache.org>
Member
Author
|
thanks, merged to master and 3.4 |
snmvaughan
pushed a commit
to snmvaughan/spark
that referenced
this pull request
Jun 20, 2023
### What changes were proposed in this pull request? Add type mapping for spark char/varchar to jdbc types. ### Why are the changes needed? The STANDARD JDBC 1.0 and other modern databases define char/varchar normatively. This is currently a kind of bug for DDLs on JDBCCatalogs for encountering errors like ``` Cause: org.apache.spark.SparkIllegalArgumentException: Can't get JDBC type for varchar(10). [info] at org.apache.spark.sql.errors.QueryExecutionErrors$.cannotGetJdbcTypeError(QueryExecutionErrors.scala:1005) ``` ### Does this PR introduce _any_ user-facing change? yes, char/varchar are allow for jdbc catalogs ### How was this patch tested? new ut Closes apache#40531 from yaooqinn/SPARK-42904. Authored-by: Kent Yao <yao@apache.org> Signed-off-by: Kent Yao <yao@apache.org> (cherry picked from commit 18cd801) Signed-off-by: Kent Yao <yao@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add type mapping for spark char/varchar to jdbc types.
Why are the changes needed?
The STANDARD JDBC 1.0 and other modern databases define char/varchar normatively.
This is currently a kind of bug for DDLs on JDBCCatalogs for encountering errors like
Does this PR introduce any user-facing change?
yes, char/varchar are allow for jdbc catalogs
How was this patch tested?
new ut