[ 
https://issues.apache.org/jira/browse/SPARK-16625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Apache Spark reassigned SPARK-16625:
------------------------------------

    Assignee: Apache Spark

> 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
>            Assignee: Apache Spark
>
> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to