calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: Date Functions in calcite - MONTH($date)
Date Fri, 04 Dec 2015 19:10:42 GMT
Did you try

  EXTRACT(MONTH FROM $DATE_COLUMN)

EXTRACT is standard (unlike MONTH) and is implemented already.

Julian

> On Dec 4, 2015, at 8:55 AM, deepak pushpakar <deepak.pushpakar@gmail.com> wrote:
> 
> Hello Calcite Developers,
> 
>   We are using Calcite for validation and parsing of hive queries. When we
> try to include a MONTH() function in one of the select columns the query,
> the query fails telling that it is not expected. I went through the code
> base of 1.4.0 and 1.50 trying to understand what I can do myself by doing
> some change and building it. I also found that MONTH function is not yet
> implemented (mentioned in the calcite website.
> Any help appreciated.
> Example query:
> SELECT MONTH($DATE_COLUMN) AS MONTH_ID, COUNT($DATA_COLUMN) AS NUM_RECORDS
> FROM $RECORDS_TABLE WHERE $COL1 = 'SOME_VALUE' GROUP BY MONTH_ID ORDER BY
> NUM_RECORDS;
> 
> 
> Thanks
> Deepak Pushpakar


Mime
View raw message