Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Mar 30, 2023

Which issue does this PR close?

Closes #5651

Rationale for this change

See #5651 (basically I want to be able to interact with intervals like normal). Also related to #5764 from @berkaysynnada

What changes are included in this PR?

  1. Add basic support for INTERVAL SQL --> DataType::Interval(MonthDayNano) arrow type
  2. Add code to go to/from ScalarValue and Interval Arrays
  3. Basic tests

Are these changes tested?

Yes

Are there any user-facing changes?

Yes (you can now do SELECT '1 day'::interval) and it works!

@github-actions github-actions bot added core Core DataFusion crate sql SQL Planner sqllogictest SQL Logic Tests (.slt) labels Mar 30, 2023
@alamb alamb force-pushed the alamb/support_interval_type branch from 80b25a9 to 06d38fa Compare March 30, 2023 14:45
arrow_typeof(interval '5 months'),
arrow_typeof(interval '5 days 3 nanoseconds')
----
Interval(YearMonth) Interval(MonthDayNano)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fact that this is Interval YearMonth is an artifact -- I think interval .. syntax should always be the same type. I will file a ticket to that effect

Copy link
Contributor Author

Choose a reason for hiding this comment

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



# Create tables with interval values
# (TODO file ticket)
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will file a ticket. Thank you for the review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alamb alamb merged commit ef90005 into apache:main Mar 30, 2023
@alamb alamb deleted the alamb/support_interval_type branch July 26, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate sql SQL Planner sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ::interval casting / INTERVAL SQL datatype

2 participants