fix: throw error on sub-day generate_series increments#11907
Merged
alamb merged 6 commits intoapache:mainfrom Aug 11, 2024
Merged
fix: throw error on sub-day generate_series increments#11907alamb merged 6 commits intoapache:mainfrom
alamb merged 6 commits intoapache:mainfrom
Conversation
alamb
reviewed
Aug 9, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
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(); |
Contributor
There was a problem hiding this comment.
👍 I think this is a very nice formulation
d547f5a to
b63b7ba
Compare
Contributor
Author
|
@alamb I rebased and updated the code to avoid those internal errors. I think root cause was me using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?
ListBuilderAre 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.