-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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-21648] [SQL] Fix confusing assert failure in JDBC source when parallel fetching parameters are not properly provided. #18864
Conversation
val jdbcOptions = new JDBCOptions(parameters) | ||
val partitionColumn = jdbcOptions.partitionColumn | ||
val lowerBound = jdbcOptions.lowerBound | ||
val upperBound = jdbcOptions.upperBound | ||
val numPartitions = jdbcOptions.numPartitions | ||
|
||
val partitionInfo = if (partitionColumn.isEmpty) { | ||
assert(lowerBound.isEmpty && upperBound.isEmpty) |
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.
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.
Thank you for pinging me, @gatorsmile .
Test build #80319 has finished for PR 18864 at commit
|
retest this please |
LGTM, pending tests |
@gatorsmile . Could you remove the following line in the PR example
to be consistent with the description?
+1, LGTM except that. |
Test build #80346 has finished for PR 18864 at commit
|
@dongjoon-hyun |
…arallel fetching parameters are not properly provided. ### What changes were proposed in this pull request? ```SQL CREATE TABLE mytesttable1 USING org.apache.spark.sql.jdbc OPTIONS ( url 'jdbc:mysql://${jdbcHostname}:${jdbcPort}/${jdbcDatabase}?user=${jdbcUsername}&password=${jdbcPassword}', dbtable 'mytesttable1', paritionColumn 'state_id', lowerBound '0', upperBound '52', numPartitions '53', fetchSize '10000' ) ``` The above option name `paritionColumn` is wrong. That mean, users did not provide the value for `partitionColumn`. In such case, users hit a confusing error. ``` AssertionError: assertion failed java.lang.AssertionError: assertion failed at scala.Predef$.assert(Predef.scala:156) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:39) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:312) ``` ### How was this patch tested? Added a test case Author: gatorsmile <gatorsmile@gmail.com> Closes #18864 from gatorsmile/jdbcPartCol. (cherry picked from commit baf5cac) Signed-off-by: gatorsmile <gatorsmile@gmail.com>
Thanks! Merging to master/2.2 |
Oh, I see. It's about typo. Thank you for fixing the error message. |
…arallel fetching parameters are not properly provided. ### What changes were proposed in this pull request? ```SQL CREATE TABLE mytesttable1 USING org.apache.spark.sql.jdbc OPTIONS ( url 'jdbc:mysql://${jdbcHostname}:${jdbcPort}/${jdbcDatabase}?user=${jdbcUsername}&password=${jdbcPassword}', dbtable 'mytesttable1', paritionColumn 'state_id', lowerBound '0', upperBound '52', numPartitions '53', fetchSize '10000' ) ``` The above option name `paritionColumn` is wrong. That mean, users did not provide the value for `partitionColumn`. In such case, users hit a confusing error. ``` AssertionError: assertion failed java.lang.AssertionError: assertion failed at scala.Predef$.assert(Predef.scala:156) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:39) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:312) ``` ### How was this patch tested? Added a test case Author: gatorsmile <gatorsmile@gmail.com> Closes apache#18864 from gatorsmile/jdbcPartCol. (cherry picked from commit baf5cac) Signed-off-by: gatorsmile <gatorsmile@gmail.com>
What changes were proposed in this pull request?
The above option name
paritionColumn
is wrong. That mean, users did not provide the value forpartitionColumn
. In such case, users hit a confusing error.How was this patch tested?
Added a test case