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

feat: Support complex interval via IntervalMonthDayNano #1615

Merged
merged 1 commit into from
Jan 21, 2022

Conversation

ovr
Copy link
Contributor

@ovr ovr commented Jan 19, 2022

Which issue does this PR close?

Closes #1017.

Rationale for this change

DF didn't support complex intervals, because it was not possible before Arrow introduced MonthDayNano type for IntervalType

What changes are included in this PR?

Support for planning complex intervals from SQL, for example:

SELECT INTERVAL '1 year 1 day 1 hour 1 minute 1 second'

Are there any user-facing changes?

No breaking changes.

@github-actions github-actions bot added datafusion Changes in the datafusion crate sql SQL Planner labels Jan 19, 2022
@ovr ovr marked this pull request as ready for review January 19, 2022 16:24
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @ovr 👨‍🍳 😗

@@ -496,6 +498,24 @@ async fn test_interval_expressions() -> Result<()> {
"interval '2' year",
"2 years 0 mons 0 days 0 hours 0 mins 0.00 secs"
);
// complex
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 nice

@houqp houqp merged commit e92225d into apache:master Jan 21, 2022
@houqp
Copy link
Member

houqp commented Jan 21, 2022

Thank you @ovr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support complex intervals (MONTH_DAY_NANO)
3 participants