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

Issue #2827: Julian Day Parts #8523

Merged
merged 17 commits into from
Aug 23, 2023
Merged

Issue #2827: Julian Day Parts #8523

merged 17 commits into from
Aug 23, 2023

Conversation

hawkfish
Copy link
Contributor

@hawkfish hawkfish commented Aug 9, 2023

Add support for the PG Julian Day date part.

This turned out to be annoying and time-consuming because JDs are DOUBLE
and every other date part is BIGINT. The approach is to separate the two types of return values
and disallow mixing (i.e., reading the date part from another column). Structs can still have julian
fields with type DOUBLE.

It was also not possible to use the rewrite rules to map DATE_PART('Julian', <expr>) to JULIAN(<expr>) because the return type changes and downstream code did not like that.

fixes #2827

Richard Wesley added 13 commits August 2, 2023 16:32
Implement Julian Day function and extraction for DATE.
TIMESTAMP and TIMESTAMP_TZ return DOUBLE and need further work.
Rebind constant Julian Day of TIMESTAMP to return DOUBLE.
Add support for non-BIGINT date parts.
Julian Days are always DOUBLE now, even for DATEs.
Still needs more tests and ICU versions.
Add remaining coverage tests for non-ICU types.
Fix missing cases in DATE_TRUNC.
Add remaining coverage tests for non-ICU types.
Fix missing cases in DATE_TRUNC.
Add missing date_diff tests.
Add DATE_PART Julian Day implementations for TSTZ.
Add remaining Julian Day implementations for TSTZ.
Remove unreachable rewrite.
@hawkfish hawkfish requested a review from Tishj August 9, 2023 13:23
Copy link
Contributor

@Tishj Tishj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a note of a few things that looked odd to me, other than that I think it looks good

Richard Wesley added 2 commits August 11, 2023 09:18
@github-actions github-actions bot marked this pull request as draft August 11, 2023 16:24
@hawkfish hawkfish marked this pull request as ready for review August 15, 2023 19:50
@hawkfish hawkfish requested a review from Tishj August 21, 2023 14:01
@github-actions github-actions bot marked this pull request as draft August 21, 2023 17:34
Copy link
Contributor

@Tishj Tishj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, looks great!

@hawkfish hawkfish marked this pull request as ready for review August 22, 2023 15:42
@hannes hannes merged commit 410b5fa into duckdb:main Aug 23, 2023
53 checks passed
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.

Postgres date part compatibility
3 participants