Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-2005

Location attribute with table properties in create table command throws parser exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3.0
    • 1.3.0
    • data-query
    • None
    • spark2.1

    Description

      I created a table using:

      import org.apache.spark.sql.SparkSession
      import org.apache.spark.sql.CarbonSession._
      import org.apache.carbondata.core.util.CarbonProperties
      import org.apache.spark.sql.streaming.

      {ProcessingTime, StreamingQuery}

      val carbon = SparkSession.builder().config(sc.getConf) .getOrCreateCarbonSession("hdfs://localhost:54311/newCarbonStore","/tmp")

      carbon.sql("create table jan8(id int, name string) stored by 'carbondata' tblproperties('streaming'='true') location '/home/geetika'").show

      It show the following exception:
      scala> carbon.sql("create table jan8(id int, name string) stored by 'carbondata' tblproperties('streaming'='true') location '/home/geetika'").show
      org.apache.spark.sql.AnalysisException: == Parse1 ==

      mismatched input 'location' expecting <EOF>(line 1, pos 96)

      == SQL ==
      create table jan8(id int, name string) stored by 'carbondata' tblproperties('streaming'='true') location '/home/geetika'
      ------------------------------------------------------------------------------------------------^^^

      == Parse2 ==
      [1.8] failure: identifier matching regex (?i)DATAMAP expected

      create table jan8(id int, name string) stored by 'carbondata' tblproperties('streaming'='true') location '/home/geetika'
      ^;;
      at org.apache.spark.sql.util.CarbonException$.analysisException(CarbonException.scala:23)
      at org.apache.spark.sql.parser.CarbonSparkSqlParser.parsePlan(CarbonSparkSqlParser.scala:64)
      at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:592)
      ... 50 elided

      Attachments

        Activity

          People

            Unassigned Unassigned
            geetikagupta Geetika Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: