[ 
https://issues.apache.org/jira/browse/CALCITE-5450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17652975#comment-17652975
 ] 

Oliver Lee commented on CALCITE-5450:
-------------------------------------

I see, so the {{unitName}} part makes it so that any of the custom time frames 
are used as the string literal and that corresponds to the entry in 
TimeFrames.java

 

The part I'm having trouble with is that the format {{WEEK(MONDAY)}} contains 
LPAREN and RPAREN, I'm still unfamiliar with JavaCC 

When I was adding in TimeUnits I had this:
{quote}TimeUnit TimeUnitForDateTrunc() :
{
}
{
    <DAY> \{ return TimeUnit.DAY; }
|
   LOOKAHEAD(4)
   <WEEK> <LPAREN> <SUNDAY> <RPAREN> \{ return TimeUnit.WEEK_SUNDAY; }
{quote}
To get it to read in the days of the week.

 

Going forward, a question: Is the name for the custom time frame going to have 
parenthesis as well?

> Add to parser WEEK(WEEKDAY) for custom time frames
> --------------------------------------------------
>
>                 Key: CALCITE-5450
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5450
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Oliver Lee
>            Priority: Minor
>
> Some BIG_QUERY functions (i.e. {{{}EXTRACT(){}}}, {{DATE_TRUNC()}} ) can 
> accept the operand
> {{WEEK(WEEKDAY)}} where {{WEEKDAY}} is one of {{SUNDAY, MONDAY, TUESDAY, 
> WEDNESDAY, THURSDAY, FRIDAY, SATURDAY}}
>  
> This is not currently supported.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to