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

Implement min/max for interval types #11015

Merged
merged 4 commits into from
Jun 23, 2024
Merged

Conversation

maxburke
Copy link
Contributor

Closes #11014

@github-actions github-actions bot added the physical-expr Physical Expressions label Jun 19, 2024
@waynexia
Copy link
Member

Thanks @maxburke for taking this! Could you also implement for the remaining two interval types? Except IntervalDayTime, there are IntervalYearMonth and IntervalMonthDayNano.

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 @maxburke and @waynexia

I also think this PR needs some tests; I wrote some for your consideration here urbanlogiq#91 (which also cover the three interval types)

@alamb alamb marked this pull request as draft June 21, 2024 16:22
@alamb
Copy link
Contributor

alamb commented Jun 21, 2024

Marking as draft while feedback is addressed (I a trying to work through the review queue)

@github-actions github-actions bot added the sqllogictest SQL Logic Tests (.slt) label Jun 22, 2024
@maxburke maxburke marked this pull request as ready for review June 22, 2024 15:33
@maxburke
Copy link
Contributor Author

@alamb merged; and feedback addressed

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 @maxburke -- this looks great 🙏

It just needs an expected output update to get the CI to pass and I think it will be good to go (I left a note on how to do so)

Thank you again for the contribution

# aggregate_decimal_min
query RT
select min(c1), arrow_typeof(min(c1)) from d_table
# aggregate Interval(MonthDayNano) min/max
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these tests needs to be updated now that you have implemented the correct logic

You can do so by running

cargo test --test sqllogictests  -- aggregate --complete

And then verifying and checking in the results

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated; I think they look right at a glance, but I'm not well versed in this part of the system. can you verify?

Copy link
Contributor

Choose a reason for hiding this comment

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

They looked good to me -- thanks!

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.

Looks good to me -- thanks again @maxburke

@alamb alamb merged commit c2ea6b3 into apache:main Jun 23, 2024
23 checks passed
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* Implement min/max for interval types

* Add sqllogictests for min/max intervals

* Add tests for interval min/max

* update sql logic tests

---------

Co-authored-by: Andrew Lamb <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement min/max for interval types
3 participants