You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Daniel Darabos (JIRA)" <ji...@apache.org> on 2016/07/19 13:21:20 UTC
[jira] [Created] (SPARK-16625) Oracle JDBC table creation fails
with ORA-00902: invalid datatype
Daniel Darabos created SPARK-16625:
--------------------------------------
Summary: Oracle JDBC table creation fails with ORA-00902: invalid datatype
Key: SPARK-16625
URL: https://issues.apache.org/jira/browse/SPARK-16625
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 1.6.2
Reporter: Daniel Darabos
Unfortunately I know very little about databases, but I figure this is a bug.
I have a DataFrame with the following schema:
{noformat}
StructType(StructField(dst,StringType,true), StructField(id,LongType,true), StructField(src,StringType,true))
{noformat}
I am trying to write it to an Oracle database like this:
{code:java}
String url = "jdbc:oracle:thin:root/rootroot@<ip address>:1521:db";
java.util.Properties p = new java.util.Properties();
p.setProperty("driver", "oracle.jdbc.OracleDriver");
df.write().mode("overwrite").jdbc(url, "my_table", p);
{code}
And I get:
{noformat}
Exception in thread "main" java.sql.SQLSyntaxErrorException: ORA-00902: invalid datatype
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:461)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:402)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1108)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:541)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:264)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:598)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:26)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1241)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1558)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:2498)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:2431)
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:975)
at org.apache.spark.sql.DataFrameWriter.jdbc(DataFrameWriter.scala:302)
{noformat}
The Oracle server I am running against is the one I get on Amazon RDS for engine type {{oracle-se}}. The same code (with the right driver) against the RDS instance with engine type {{MySQL}} works.
The error message is the same as in https://issues.apache.org/jira/browse/SPARK-12941. Could it be that {{Long}} is also translated into the wrong data type? Thanks.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org