> Order rule should keep consistent for create datamap
> ----------------------------------------------------
>
> Key: CARBONDATA-2087
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-2087> Project: CarbonData
> Issue Type: Bug
> Components: core, spark-integration
> Affects Versions: 1.3.0
> Reporter: xubo245
> Priority: Minor
> Fix For: 1.3.0
>
>
> It success:
> {code:java}
> test("test timeseries create table 18: support day=1,year=1,month=1") {
> try {
> sql(
> """create datamap agg1 on table mainTable
> | using 'preaggregate'
> | DMPROPERTIES (
> | 'timeseries.eventTime'='dataTime',
> | 'timeseries.hierarchy'='day=1,year=1,month=1')
> | as select dataTime, sum(age) from mainTable
> | group by dataTime
> """.stripMargin)
> checkExistence(sql("show tables"), false, "maintable_agg1_hour")
> checkExistence(sql("show tables"), true, "maintable_agg1_day", "maintable_agg1_month", "maintable_agg1_year")
> } catch {
> case _: Exception =>
> assert(false)
> }
> }
> {code}
> but it fail:
> {code:java}
> test("test timeseries create table 21: don't support year=1,month=1") {
> try {
> sql(
> """create datamap agg1 on table mainTable
> |using 'preaggregate'
> |DMPROPERTIES (
> | 'timeseries.eventTime'='dataTime',
> | 'timeseries.hierarchy'='year=1,month=1')
> |as select dataTime, sum(age) from mainTable
> |group by dataTime""".stripMargin)
> assert(false)
> } catch {
> case e: MalformedCarbonCommandException =>
> assert(e.getMessage.contains("year=1,month=1 is in wrong order"))
> } finally {
> checkExistence(sql("show tables"), false, "maintable_agg1_year")
> }
> }
> {code}