Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-21648

Confusing assert failure in JDBC source when users misspell the option `partitionColumn`

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.2.1, 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      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)
      

        Attachments

          Activity

            People

            • Assignee:
              smilegator Xiao Li
              Reporter:
              smilegator Xiao Li
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: