You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Cassa L <lc...@gmail.com> on 2017/07/20 06:21:13 UTC
Spark-2.0 and Oracle 12.1 error: Unsupported type -101
Hi,
I am trying to read data into Spark from Oracle using ojdb7 driver. The
data is in JSON format. I am getting below error. Any idea on how to
resolve it?
ava.sql.SQLException: Unsupported type -101
at
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$getCatalystTy
====
My code is very simple
SparkSession spark = SparkSession
.builder()
.appName("Oracle Example")
.master("local[4]")
.getOrCreate();
final Properties connectionProperties = new Properties();
connectionProperties.put("user",*"XXX"*);
connectionProperties.put("password", "XXX"));
final String dbTable =
"(select * from MyTable)";
Dataset<Row> jdbcDF = spark.read().jdbc(*XXXXX*, dbTable, connectionProperties);
//jdbcDF.show();