You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by "Geetika Gupta (JIRA)" <ji...@apache.org> on 2018/01/15 10:37:00 UTC

[jira] [Commented] (CARBONDATA-2005) Location attribute with table properties in create table command throws parser exception

    [ https://issues.apache.org/jira/browse/CARBONDATA-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326093#comment-16326093 ] 

Geetika Gupta commented on CARBONDATA-2005:
-------------------------------------------

This bug can be closed as LOCATION attribute should be specified before TBLPROPERTIES attribute

> Location attribute with table properties in create table command throws parser exception
> ----------------------------------------------------------------------------------------
>
>                 Key: CARBONDATA-2005
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2005
>             Project: CarbonData
>          Issue Type: Bug
>          Components: data-query
>    Affects Versions: 1.3.0
>         Environment: spark2.1
>            Reporter: Geetika Gupta
>            Priority: Minor
>             Fix For: 1.3.0
>
>
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)