[ https://issues.apache.org/jira/browse/CALCITE-5554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17697238#comment-17697238 ]
Tanner Clary commented on CALCITE-5554: --------------------------------------- [~julianhyde] I added a commit that addresses your 2nd and 3rd concerns. As for the 1st, I did consider adding them as custom time frames but I felt that since the only key difference between them and the standard DOY and DOW time units is their expanded name, it made sense to add them as synonyms in the parser. I see this the same way that HOURS is linked to TimeUnit.HOUR (or any other plural time unit). It's also worth noting that I don't believe the EXTRACT() function is currently implemented to handle custom time frames, as the actual math all occurs in Avatica using time units (not time frames). If I've misunderstood something or you'd still like me to make that change, just let me know. Thanks. > Add DAYOFWEEK and DAYOFYEAR as valid synonyms of DOW, DOY > --------------------------------------------------------- > > Key: CALCITE-5554 > URL: https://issues.apache.org/jira/browse/CALCITE-5554 > Project: Calcite > Issue Type: Improvement > Reporter: Tanner Clary > Assignee: Tanner Clary > Priority: Major > Labels: pull-request-available > Time Spent: 40m > Remaining Estimate: 0h > > Currently, a query such as: {{EXTRACT(DAYOFWEEK FROM DATE '2008-12-25');}} is > invalid while {{EXTRACT(DOW FROM DATE '2008-12-25')}} is acceptable. BigQuery > (and perhaps other dialects) accept the non-abbreviated version as a valid > time unit. After this change, DAYOFWEEK and DAYOFYEAR would both be synonyms > of DOW and DOY, respectively. > [Relevant BigQuery > Docs|https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#extract] > Any comments, questions, or suggestions for the linked PR are highly > appreciated. -- This message was sent by Atlassian Jira (v8.20.10#820010)