[ https://issues.apache.org/jira/browse/CALCITE-5554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17697578#comment-17697578 ]
Julian Hyde commented on CALCITE-5554: -------------------------------------- That sounds reasonable, given that {{EXTRACT}} is implemented differently from other I see that [DATE_PART on Snowflake|https://docs.snowflake.com/en/sql-reference/functions-date-time#label-supported-date-time-parts] allows weekday, dow, dw as synonyms for dayofweek, and yearday, doy, dy as synonyms for dayofyear. So, if we revisit {{DATE_PART}} we can also revisit {{EXTRACT}}. Re. enabling tests. The point of CALCITE-2539 is that {{checkFails}} is a no-op. (I.e. the test will pass even if the expression does not fail.) So some of those tests would actually succeed if you change {{checkFails}} to an appropriate {{checkScalar}}. Change as many as you can to {{checkScalar}}, and leave the other {{checkFails}} inside an {{if}}. > 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: 50m > 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)