carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravindra Pesala (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CARBONDATA-2118) It should throw error when create datamap uses like "as select a as a1,sum(b) from tablename"
Date Sat, 03 Feb 2018 10:21:00 GMT

     [ https://issues.apache.org/jira/browse/CARBONDATA-2118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ravindra Pesala updated CARBONDATA-2118:
----------------------------------------
    Fix Version/s:     (was: 1.3.0)
                   1.4.0

> It should  throw error when create datamap uses like "as select a as a1,sum(b) from tablename"
> ----------------------------------------------------------------------------------------------
>
>                 Key: CARBONDATA-2118
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-2118
>             Project: CarbonData
>          Issue Type: Bug
>          Components: core, spark-integration
>    Affects Versions: 1.3.0
>            Reporter: xubo245
>            Assignee: xubo245
>            Priority: Major
>             Fix For: 1.4.0
>
>
> 	After create datamap  using
> {code:java}
>  create datamap preagg2 on table PreAggMain using 'preaggregate' as select a as a1,sum(b)
from PreAggMain group by a
> {code}
> it will error when select a1:
> {code:java}
>     sql("select a1 from PreAggMain_preagg2").show()
> {code}
> It should  throw error when create datamap.
> code:
> {code:java}
> 	  test("test pre agg create table 2") {
> 	    sql("create datamap preagg2 on table PreAggMain using 'preaggregate' as select a
as a1,sum(b) from PreAggMain group by a")
> 	    checkExistence(sql("DESCRIBE FORMATTED PreAggMain_preagg2"), true, "preaggmain_a")
> 	    checkExistence(sql("DESCRIBE FORMATTED PreAggMain_preagg2"), true, "preaggmain_b_sum")
> 	    checkExistence(sql("DESCRIBE FORMATTED PreAggMain_preagg2"), false, "preaggmain_a1")
> 	    sql("DESCRIBE FORMATTED PreAggMain_preagg2").show()
> 	    sql("select * from PreAggMain_preagg2").show()
> 	    sql("select a1 from PreAggMain_preagg2").show()
> 	
> 	    sql("DESCRIBE FORMATTED PreAggMain").show()
> 	    sql("select * from PreAggMain").show()
> 	    sql("select a as a1,sum(b) from PreAggMain group by a").show()
> 	
> 	    sql("drop datamap preagg2 on table PreAggMain")
> 	  }
> {code}
> error:
> 	{code:java}
> 	+------------+----------------+
> 	|preaggmain_a|preaggmain_b_sum|
> 	+------------+----------------+
> 	+------------+----------------+
> 	
> 	
> 	cannot resolve '`a1`' given input columns: [preaggmain_a, preaggmain_b_sum]; line 1
pos 7;
> 	'Project ['a1]
> 	+- SubqueryAlias preaggmain_preagg2
> 	   +- Relation[preaggmain_a#101,preaggmain_b_sum#102] CarbonDatasourceHadoopRelation
[ Database name :default, Table name :preaggmain_preagg2, Schema :Some(StructType(StructField(preaggmain_a,StringType,true),
StructField(preaggmain_b_sum,DoubleType,true))) ]
> 	
> 	org.apache.spark.sql.AnalysisException: cannot resolve '`a1`' given input columns: [preaggmain_a,
preaggmain_b_sum]; line 1 pos 7;
> 	'Project ['a1]
> 	+- SubqueryAlias preaggmain_preagg2
> 	   +- Relation[preaggmain_a#101,preaggmain_b_sum#102] CarbonDatasourceHadoopRelation
[ Database name :default, Table name :preaggmain_preagg2, Schema :Some(StructType(StructField(preaggmain_a,StringType,true),
StructField(preaggmain_b_sum,DoubleType,true))) ]
> 	
> 		at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
> 		at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:88)
> 		at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:85)
> {code}



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

Mime
View raw message