Re: How can I use substr function in query or find an alternative way

2017-05-25 Thread Julian Hyde
Except that PERIOD becomes a reserved keyword in the next version of Calcite. :) On Thu, May 25, 2017 at 6:33 PM, Billy Liu wrote: > A better way is to define PERIOD in your Hive view, and load the Hive view > as the fact table. > > 2017-05-25 14:47 GMT+08:00 jiawei chen : > >> Hi kylin's develop

Re: How can I use substr function in query or find an alternative way

2017-05-25 Thread Billy Liu
A better way is to define PERIOD in your Hive view, and load the Hive view as the fact table. 2017-05-25 14:47 GMT+08:00 jiawei chen : > Hi kylin's developers, > I am using kylin-1.6.0 now. I have to use a sql query like: > > SELECT > SUBSTR(TO_CHAR(`time`,'MMDDHH24MISS'),9,2) AS PERIOD,

Re: How can I use substr function in query or find an alternative way

2017-05-25 Thread ShaoFeng Shi
Hi Jiawei, did you check Apache Calcite's SQL grammer? Kylin uses Calcite to parse SQL, it can help: https://calcite.apache.org/docs/reference.html 2017-05-25 14:47 GMT+08:00 jiawei chen : > Hi kylin's developers, > I am using kylin-1.6.0 now. I have to use a sql query like: > > SELECT > SUBS

How can I use substr function in query or find an alternative way

2017-05-25 Thread jiawei chen
Hi kylin's developers, I am using kylin-1.6.0 now. I have to use a sql query like: SELECT SUBSTR(TO_CHAR(`time`,'MMDDHH24MISS'),9,2) AS PERIOD, COUNT(*) AS LL, FROM table_name GROUP BY SUBSTR(TO_CHAR(`time`,'MMDDHH24MISS'),9,2); and I got a failed response that shows no match found fo