Skip to content

[CALCITE-5554] Add DAYOFWEEK and DAYOFYEAR as valid synonyms of DOW, DOY#3094

Closed
tanclary wants to merge 2 commits intoapache:mainfrom
tanclary:extract-dayofweek
Closed

[CALCITE-5554] Add DAYOFWEEK and DAYOFYEAR as valid synonyms of DOW, DOY#3094
tanclary wants to merge 2 commits intoapache:mainfrom
tanclary:extract-dayofweek

Conversation

@tanclary
Copy link
Copy Markdown
Contributor

@tanclary tanclary commented Mar 3, 2023

JIRA Case: https://issues.apache.org/jira/browse/CALCITE-5554
Minor change to parser to accept "DAYOFWEEK" and "DAYOFYEAR" that correlate to the DOW and DOY time units, respectively.

Note that DAYOFWEEK and DAYOFYEAR are also valid 1-operand functions that return the corresponding DOW or DOY for a provided date. (They are equivalent to EXTRACT(DOW/DOY from DATE)). This is also the case for other time units like HOUR and MINUTE so I tried to mirror how they handled a token that could be both a valid qualifier and function name.

Please let me know if you have any comments, questions, or suggestions. Thanks!

@tanclary tanclary force-pushed the extract-dayofweek branch 5 times, most recently from 265162c to 4c7ac6e Compare March 3, 2023 19:39
@tanclary tanclary force-pushed the extract-dayofweek branch from 4c7ac6e to c9a7181 Compare March 3, 2023 19:48
@zoudan
Copy link
Copy Markdown
Contributor

zoudan commented Mar 6, 2023

LGTM

@tanclary tanclary force-pushed the extract-dayofweek branch from 04d6597 to 2188b20 Compare March 9, 2023 00:55
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 5 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Mar 9, 2023
…nonyms for DOW, DOY

Add operator tests, and re-enable some of the tests disabled
in [CALCITE-2539].

Close apache#3094
julianhyde pushed a commit to julianhyde/calcite that referenced this pull request Mar 18, 2023
…nonyms for DOW, DOY

Add operator tests, and re-enable some of the tests disabled
in [CALCITE-2539].

Close apache#3094
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants