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

Can't have table as identifier in OPTIONS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0
    • 1.4.0
    • SQL
    • None

    Description

      The following query fails because there is an identifier "table" in OPTIONS

      CREATE TEMPORARY TABLE ddlTable
      USING org.apache.spark.sql.cassandra
      OPTIONS (
       table "test1",
       keyspace "test"
      )
      

      The following error

      ]   java.lang.RuntimeException: [1.2] failure: ``insert'' expected but identifier CREATE found
      [info] 
      [info]  CREATE TEMPORARY TABLE ddlTable USING org.apache.spark.sql.cassandra OPTIONS (  table "test1",  keyspace "dstest"  )       
      [info]  ^
      [info]   at scala.sys.package$.error(package.scala:27)
      [info]   at org.apache.spark.sql.catalyst.AbstractSparkSQLParser.apply(AbstractSparkSQLParser.scala:40)
      [info]   at org.apache.spark.sql.SQLContext$$anonfun$2.apply(SQLContext.scala:130)
      [info]   at org.apache.spark.sql.SQLContext$$anonfun$2.apply(SQLContext.scala:130)
      [info]   at org.apache.spark.sql.SparkSQLParser$$anonfun$org$apache$spark$sql$SparkSQLParser$$others$1.apply(SparkSQLParser.scala:96)
      [info]   at org.apache.spark.sql.SparkSQLParser$$anonfun$org$apache$spark$sql$SparkSQLParser$$others$1.apply(SparkSQLParser.scala:95)
      [info]   at scala.util.parsing.combinator.Parsers$Success.map(Parsers.scala:136)
      [info]   at scala.util.parsing.combinator.Parsers$Success.map(Parsers.scala:135)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply(Parsers.scala:242)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$map$1.apply(Parsers.scala:242)
      [info]   at scala.util.parsing.combinator.Parsers$$anon$3.apply(Parsers.scala:222)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1$$anonfun$apply$2.apply(Parsers.scala:254)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1$$anonfun$apply$2.apply(Parsers.scala:254)
      [info]   at scala.util.parsing.combinator.Parsers$Failure.append(Parsers.scala:202)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1.apply(Parsers.scala:254)
      [info]   at scala.util.parsing.combinator.Parsers$Parser$$anonfun$append$1.apply(Parsers.scala:254)
      [info]   at scala.util.parsing.combinator.Parsers$$anon$3.apply(Parsers.scala:222)
      [info]   at scala.util.parsing.combinator.Parsers$$anon$2$$anonfun$apply$14.apply(Parsers.scala:891)
      [info]   at scala.util.parsing.combinator.Parsers$$anon$2$$anonfun$apply$14.apply(Parsers.scala:891)
      [info]   at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
      [info]   at scala.util.parsing.combinator.Parsers$$anon$2.apply(Parsers.scala:890)
      [info]   at scala.util.parsing.combinator.PackratParsers$$anon$1.apply(PackratParsers.scala:110)
      [info]   at org.apache.spark.sql.catalyst.AbstractSparkSQLParser.apply(AbstractSparkSQLParser.scala:38)
      [info]   at org.apache.spark.sql.SQLContext$$anonfun$parseSql$1.apply(SQLContext.scala:134)
      [info]   at org.apache.spark.sql.SQLContext$$anonfun$parseSql$1.apply(SQLContext.scala:134)
      [info]   at scala.Option.getOrElse(Option.scala:120)
      [info]   at org.apache.spark.sql.SQLContext.parseSql(SQLContext.scala:134)
      

      Attachments

        Activity

          People

            viirya L. C. Hsieh
            alexliu68 Alex Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: