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

JdbcUtils.makeGetter does not handle ByteType

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.5, 3.0.0
    • SQL
    • None

    Description

      I am trying to use the DataSource V2 API to read from a JDBC source. While using JdbcUtils.resultSetToSparkInternalRows to create an internal row from a ResultSet that has a column of type TINYINT I ran into the following exception

      java.lang.IllegalArgumentException: Unsupported type tinyint
      	at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$makeGetter(JdbcUtils.scala:502)
      	at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$makeGetters$1.apply(JdbcUtils.scala:379)
      	at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$makeGetters$1.apply(JdbcUtils.scala:379)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
      	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
      	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
      	at scala.collection.mutable.ArrayOps$ofRef.map(ArrayOps.scala:186)
      	at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$makeGetters(JdbcUtils.scala:379)
      	at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anon$1.<init>(JdbcUtils.scala:340)
      

      This happens because ByteType is not handled in JdbcUtils.makeGetter.

      Attachments

        Activity

          People

            tdsilva Thomas D'Silva
            tdsilva Thomas D'Silva
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: