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

Umesh Chaudhary updated SPARK-20319:
------------------------------------
    Description: 
The issue was caused by 
[SPARK-16387|https://issues.apache.org/jira/browse/SPARK-16387] where reserved 
SQL words are honored by wrapping quotes on column names. 

In our test we found that when quotes are explicitly wrapped in column names 
then Oracle JDBC driver is throwing : 

java.sql.BatchUpdateException: ORA-01741: illegal zero-length identifier 
at 
oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12296)
 
at 
oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:246)
 
at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:597)
 

and Cassandra JDBC driver is throwing : 

17/04/12 19:03:48 ERROR executor.Executor: Exception in task 0.0 in stage 5.0 
(TID 6)
java.sql.SQLSyntaxErrorException: [FMWGEN][Cassandra JDBC 
Driver][Cassandra]syntax error or access rule violation: base table or view not 
found: 
        at weblogic.jdbc.cassandrabase.ddcl.b(Unknown Source)
        at weblogic.jdbc.cassandrabase.ddt.a(Unknown Source)
        at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
Source)
        at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
Source)
        at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.insertStatement(JdbcUtils.scala:118)
        at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:571)

CC: [~rxin] , [~joshrosen]


  was:
The issue was caused by 
[SPARK-16387|https://issues.apache.org/jira/browse/SPARK-16387] where reserved 
SQL words are honored by wrapping quotes on column names. 

In our test we found that when quotes are explicitly wrapped in column names 
then Oracle JDBC driver is throwing : 

java.sql.BatchUpdateException: ORA-01741: illegal zero-length identifier 
at 
oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12296)
 
at 
oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:246)
 
at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:597)
 

and Cassandra JDBC driver is throwing : 

17/04/12 19:03:48 ERROR executor.Executor: Exception in task 0.0 in stage 5.0 
(TID 6)
java.sql.SQLSyntaxErrorException: [FMWGEN][Cassandra JDBC 
Driver][Cassandra]syntax error or access rule violation: base table or view not 
found: 
        at weblogic.jdbc.cassandrabase.ddcl.b(Unknown Source)
        at weblogic.jdbc.cassandrabase.ddt.a(Unknown Source)
        at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
Source)
        at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
Source)
        at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.insertStatement(JdbcUtils.scala:118)
        at 
org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:571)



> Already quoted identifiers are getting wrapped with additional quotes
> ---------------------------------------------------------------------
>
>                 Key: SPARK-20319
>                 URL: https://issues.apache.org/jira/browse/SPARK-20319
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0, 2.1.0
>            Reporter: Umesh Chaudhary
>
> The issue was caused by 
> [SPARK-16387|https://issues.apache.org/jira/browse/SPARK-16387] where 
> reserved SQL words are honored by wrapping quotes on column names. 
> In our test we found that when quotes are explicitly wrapped in column names 
> then Oracle JDBC driver is throwing : 
> java.sql.BatchUpdateException: ORA-01741: illegal zero-length identifier 
> at 
> oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:12296)
>  
> at 
> oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:246)
>  
> at 
> org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:597)
>  
> and Cassandra JDBC driver is throwing : 
> 17/04/12 19:03:48 ERROR executor.Executor: Exception in task 0.0 in stage 5.0 
> (TID 6)
> java.sql.SQLSyntaxErrorException: [FMWGEN][Cassandra JDBC 
> Driver][Cassandra]syntax error or access rule violation: base table or view 
> not found: 
>       at weblogic.jdbc.cassandrabase.ddcl.b(Unknown Source)
>       at weblogic.jdbc.cassandrabase.ddt.a(Unknown Source)
>       at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
> Source)
>       at weblogic.jdbc.cassandrabase.BaseConnection.prepareStatement(Unknown 
> Source)
>       at 
> org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.insertStatement(JdbcUtils.scala:118)
>       at 
> org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.savePartition(JdbcUtils.scala:571)
> CC: [~rxin] , [~joshrosen]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to