Details
Description
Reading from an Oracle DB table with a column of type TIMESTAMP WITH TIME ZONE via jdbc (spark.sqlContext.read.format("jdbc").option(...).load()) results in an error:
Unsupported type -101
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$getCatalystType(JdbcUtils.scala:209)
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$5.apply(JdbcUtils.scala:246)
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$5.apply(JdbcUtils.scala:246)
That is because the type java.sql.Types.TIMESTAMP_WITH_TIMEZONE (in Java since 1.8) is missing in JdbcUtils.scala
This is similar to SPARK-7039.
I created a pull request with a fix.