[ https://issues.apache.org/jira/browse/CARBONDATA-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] xubo245 closed CARBONDATA-2084. ------------------------------- Resolution: Invalid > Timeseries pre-aggregate table should support min and max when the create datamap don't as select max and min > ------------------------------------------------------------------------------------------------------------- > > Key: CARBONDATA-2084 > URL: https://issues.apache.org/jira/browse/CARBONDATA-2084 > Project: CarbonData > Issue Type: Bug > Components: core, spark-integration > Affects Versions: 1.3.0 > Reporter: xubo245 > Priority: Major > Fix For: 1.3.0 > > > {code:java} > override def beforeAll: Unit = { > SparkUtil4Test.createTaskMockUp(sqlContext) > CarbonProperties.getInstance() > .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, > CarbonCommonConstants.CARBON_TIMESTAMP_DEFAULT_FORMAT) > sql("drop table if exists mainTable") > sql("CREATE TABLE mainTable(mytime timestamp, name string, age int) STORED BY 'org.apache.carbondata.format'") > sql("create datamap agg0 on table mainTable using 'preaggregate' DMPROPERTIES ('timeseries.eventTime'='mytime', 'timeseries.hierarchy'='second=1,minute=1,hour=1,day=1,month=1,year=1') as select mytime, sum(age) from mainTable group by mytime") > sql(s"LOAD DATA LOCAL INPATH '$resourcesPath/timeseriestest.csv' into table mainTable") > } > {code} > {code:java} > // TODO: support max > ignore("test PreAggregate table selection 38: filter < and >=, max") { > val df = sql( > """ > | select > | timeseries(mytime,'second') as secondLevel, > | max(age) as maxValue > | from mainTable > | where timeseries(mytime,'second')<'2016-02-23 01:02:00' and timeseries(mytime,'second')>='2016-02-23 01:01:00' > | group by > | timeseries(mytime,'second') > | order by > | timeseries(mytime,'second') > """.stripMargin) > df.show() > checkAnswer(df, Seq(Row(Timestamp.valueOf("2016-02-23 01:01:50"), 30))) > } > ignore("test PreAggregate table selection 39: filter < and >=, min") { > val df = sql( > """ > | select > | timeseries(mytime,'second') as secondLevel, > | min(age) as minValue > | from mainTable > | where timeseries(mytime,'second')<'2016-02-23 01:02:00' and timeseries(mytime,'second')>='2016-02-23 01:01:00' > | group by > | timeseries(mytime,'second') > | order by > | timeseries(mytime,'second') > """.stripMargin) > df.show() > checkAnswer(df, Seq(Row(Timestamp.valueOf("2016-02-23 01:01:30"), 10))) > } > {code} > detail please see my branch: https://github.com/xubo245/carbondata/tree/usingTimeseries -- This message was sent by Atlassian JIRA (v7.6.3#76005) |
Free forum by Nabble | Edit this page |