Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-29085

spark jdbc query to oracle "__SPARK_GEN_JDBC_SUBQUERY_NAME_" "__" not suport by ORACLE

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.4.3
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None

      Description

      when i use spark sql that jdbc connect to query data from oracle,

       

      // code placeholder
      Dataset<Row> jdbcDF = sqlContext.read()
              .format("jdbc")
              .option("url", "jdbc:oracle:thin:@192.168.2.3/orcltest11g")
              .option("query", "select * from tdb.user u")
              .option("user", "tdb")
              .option("password", "tdb")
              .load();
      

      will throw error exception

       

       

      // code placeholder
      Exception in thread "main" java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
      

       

      in debug model 

       

      // code placeholder
      (select * from tdb.user u) __SPARK_GEN_JDBC_SUBQUERY_NAME_0
      

      copy this sql to oracle client shell

      will return same error <__SPARK_GEN_JDBC_SUBQUERY_NAME_0>

       

       

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                leookok leookok
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: