Hi Feng!
You can transform the timestamp column to day,hour two columns in hive
before you create cube.
Then in cube design. You can add hierarchy dimensions like day,hour.
In the sql: select day,hour,sum(sales) from table group by day,hour
在 2015年09月01日 17:07, yu feng 写道:
Hi all :
I have use kylin for about one month,but can not find how to generate
time hierarchy based on my timestamp column, I have an HIVE table like this:
CREATE TABLE `sales_table`(
`time` timestamp,
`sales` int)
and I have a timestamp column named time, I want to get result like this :
select date(time) ,hour(time),sum(sales) from sales_table group by
date(time), hour(time);
2015-08-27 16 18388
2015-08-27 17 35301
2015-08-27 18 41884
2015-08-27 19 40638
2015-08-27 20 40294
2015-08-27 21 43753
i.e. you can generate full time hierachy like year/month/day/hour.. when
you have a timestamp column.
I have no idea how to achieve it with kylin and I will appreciate it very
much if someone can help me,Thanks~~