Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 5273 Postrgesql extract from temporal types #5274

Merged
merged 11 commits into from
Jul 17, 2024

Conversation

griffio
Copy link
Contributor

@griffio griffio commented May 24, 2024

fixes #5273
fixes #5340

🚧 🕐 Extract Function https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT

Adds grammar for extract_temporal_expression
Adds DATE and TIME literals as missing from grammar to include in EXTRACT
Adds mixin to find the expression for the resolver to use
Adds validate temporal types in resolver
Adds fixture test
Adds integration test for real use case in constraint

@griffio griffio changed the title Add Postrgesql extract from Add 5274 Postrgesql extract from temporal types May 24, 2024
@griffio griffio changed the title Add 5274 Postrgesql extract from temporal types Add 5273 Postrgesql extract from temporal types May 24, 2024
@griffio griffio force-pushed the add-postrgesql-extract-from branch from 5ae4adb to 9f39396 Compare May 28, 2024 14:15
@griffio griffio force-pushed the add-postrgesql-extract-from branch from 9f39396 to 06c9cf2 Compare July 9, 2024 16:26
@griffio griffio marked this pull request as ready for review July 9, 2024 17:15
extract temporal fields
fixture test
integration test
todo - bind arg test "?" needs cast e.g `?::TIMESTAMP`
Add Support for:

SELECT EXTRACT(MONTH FROM DATE '2023-05-15');

SELECT EXTRACT(HOUR FROM TIME '10:30:45');
SELECT EXTRACT(MONTH FROM DATE '2023-05-15');

SELECT EXTRACT(HOUR FROM TIME '10:30:45');
To support Extract
Literal Date and Time tests
Integration Test for Extract
Add error to validate temporal types
Integration test for INTERVAL returns double(3)
Add latest temporal fields (22)
@griffio griffio force-pushed the add-postrgesql-extract-from branch from 06c9cf2 to aa97acb Compare July 16, 2024 18:22
@JakeWharton JakeWharton merged commit 6bb8711 into cashapp:master Jul 17, 2024
11 checks passed
@griffio griffio deleted the add-postrgesql-extract-from branch July 17, 2024 13:33
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.

Add DATE and TIME Literals for Postgresql Dialect Add EXTRACT function to PostgreSql Dialect
2 participants