> Select Query failed with preagg having timeseries and normal agg table together
> -------------------------------------------------------------------------------
>
> Key: CARBONDATA-2028
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-2028> Project: CarbonData
> Issue Type: Bug
> Reporter: Babulal
> Assignee: Babulal
> Priority: Major
> Fix For: 1.3.0
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> sql("drop table if exists maintabletime")
> sql("create table maintabletime(year int,month int,name string,salary int,dob timestamp) stored by 'carbondata' tblproperties('sort_scope'='Global_sort','table_blocksize'='23','sort_columns'='month,year,name')")
> sql("insert into maintabletime select 10,11,'babu',12,'2014-01-01 00:00:00'")
> sql("create datamap agg0 on table maintabletime using 'preaggregate' as select dob,name from maintabletime group by dob,name")
> sql("create datamap agg1 on table maintabletime using 'preaggregate' DMPROPERTIES ('timeseries.eventTime'='dob', 'timeseries.hierarchy'='hour=1,day=1,month=1,year=1') as select dob,name from maintabletime group by dob,name")
> val df = sql("select timeseries(dob,'year') from maintabletime group by timeseries(dob,'year')")
>
>
> *Exception*
> Exception in thread "main" org.apache.spark.sql.AnalysisException: Column does not exists in Pre Aggregate table;
> at org.apache.spark.sql.hive.CarbonPreAggregateQueryRules.getChildAttributeReference(CarbonPreAggregateRules.scala:719)
> at org.apache.spark.sql.hive.CarbonPreAggregateQueryRules$$anonfun$19$$anonfun$4.applyOrElse(CarbonPreAggregateRules.scala:855)