GitHub user gatorsmile opened a pull request:
https://github.com/apache/spark/pull/18864
[SPARK-21648] [SQL] Fix confusing assert failure in JDBC source when
parallel 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
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gatorsmile/spark jdbcPartCol
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18864.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #18864
----
commit e4aac502d58972063a1ab25f17a1c217abe97b97
Author: gatorsmile <[email protected]>
Date: 2017-08-05T05:38:15Z
improve message.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]