-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-46612][SQL] Do not convert array type string retrieved from jdbc driver #44459
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-46612][SQL] Do not convert array type string retrieved from jdbc driver #44459
Conversation
|
Thanks for the PR. Mind creating a JIRA please? (see also https://spark.apache.org/contributing.html). |
Thanks for the reply @HyukjinKwon. I've applied for a JIRA account at https://selfserve.apache.org/jira-account.html, will be creating the story when the account is approved. Update: JIRA is created https://issues.apache.org/jira/browse/SPARK-46612 |
|
Hi @phanhuyn, Could you enable the GitHub action? |
c46a8fc to
c26ff83
Compare
I enabled GitHub action and triggered a few builds. It's failing at "Run documentation build" step. I'm not sure why this change would cause the documentation build to fail, could you help to take a look? Thank you. The action url: https://github.com/phanhuyn/spark/actions/runs/7522708428/job/20479020431 |
|
This build error shall be fixed, you can rebase the master branch and try again. |
yaooqinn
left a comment
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.
It looks reasonable to me to respect the underlying database-specific type definition
|
Thank you @phanhuyn. Merged to master |
|
thanks @yaooqinn |
|
Oops, I didn't pay much attention to the authorship resolution step in the merge script, the |
All good, no problem. |

Hi, thanks for checking the PR. This is a small bug fix to make Scala Spark works with Clickhouse's array type. Let me know if this could cause problem on other DB types.
(Please help to trigger CI if possible. I failed to make the build pipeline run - any help is appreciated)
Why are the changes needed?
The PR is to fix issue describe at: ClickHouse/clickhouse-java#1505
When using spark to write an array of string to Clickhouse, the Clickhouse JDBC driver throws
java.lang.IllegalArgumentException: Unknown data type: stringexception.The exception was due to Spark JDBC utils passing an invalid type value
string(should beString). The original type values retrieved from Clickhouse JDBC is correct, but Spark JDBC utils attempts to convert to type string to lower case:spark/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
Line 639 in 6b93153
What changes were proposed in this pull request?
Does this PR introduce any user-facing change?
No
How was this patch tested?
java.lang.IllegalArgumentException: Unknown data type: stringwhen write array string with Apache Spark scala ClickHouse/clickhouse-java#1505Was this patch authored or co-authored using generative AI tooling?
No