You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "sergio (JIRA)" <ji...@apache.org> on 2017/03/29 13:06:41 UTC

[jira] [Created] (SPARK-20141) jdbc query gives ORA-00903

sergio created SPARK-20141:
------------------------------

             Summary: jdbc query gives ORA-00903
                 Key: SPARK-20141
                 URL: https://issues.apache.org/jira/browse/SPARK-20141
             Project: Spark
          Issue Type: Bug
          Components: Input/Output
    Affects Versions: 2.0.2
         Environment: Windows7
            Reporter: sergio


Error while querying to external oracle database. 
It works this way and then I can work with jdbcDF:

val jdbcDF = sqlContext.read.format("jdbc").options(
  Map("url" -> "jdbc:oracle:thin:@//crmdbmr.cgs.comp.ru:1521/crmrmir",
  "user" -> "my_login",
  "password" -> "my_password",
  "dbtable" -> "siebel.table1")).load() 

while when trying to send some query, it fails 

val jdbcDF = sqlContext.read.format("jdbc").options(
  Map("url" -> "jdbc:oracle:thin:@//crmdbmr.cgs.comp.ru:1521/crmrmir",
  "user" -> "my_login",
  "password" -> "my_password",
  "dbtable" -> "select * from siebel.table1 where call_id= '1-1TMC4D4U'")).load() 

This query works fine in SQLDeveloper, or when i registerTempTable, but when I put direct query instead of schema.table, it gives this error:
java.sql.SQLSyntaxErrorException: ORA-00903:

It looks like spark sends wrong query.
I tried everything in "JDBC To Other Databases":
http://spark.apache.org/docs/latest/sql-programming-guide.html



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org