-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: throw error on sub-day generate_series increments #11907
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @tshauck -- I think this code looks much nicer 👌 -- thank you
While reviewing this PR I had some more ideas for tests, so I took the liberty of writing them and pushing a few to your branch.
During this process, I actually think I found a regression introduced by this PR. Specifically, when generating intervals from arrays. If you try and run the tests in #11921 on this PR they all generate internal errors.
let mut values = vec![]; | ||
let mut offsets = vec![0]; | ||
// values are date32s | ||
let values_builder = Date32Builder::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think this is a very nice formulation
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
d547f5a
to
b63b7ba
Compare
@alamb I rebased and updated the code to avoid those internal errors. I think root cause was me using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tshauck -- this looks great to me
Which issue does this PR close?
closes #11823
Rationale for this change
Currently, when trying to generate a series of dates with increments less than a day, the query will hang due to loss of precision (the step size becomes 0 relative to the Date32).
What changes are included in this PR?
ListBuilder
Are these changes tested?
Yes, added a test.
Are there any user-facing changes?
Minor in that queries will now error when they would've hung forever.