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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.4.3
    • None
    • SQL
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: