-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Update date_bin to support Time32 and Time64 data types #19341
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
Conversation
martin-g
left a comment
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.
Consider adding the following constants:
const NANOS_PER_MILLI: i64 = 1_000_000;
const NANOS_PER_SEC: i64 = 1_000_000_000;
const NANOS_PER_MICRO: i64 = 1_000;|
Thanks for the review @martin-g. I've implemented your review feedback - sorry for the numerous bugs in that initial version :( |
Co-authored-by: Martin Grigorov <[email protected]>
…ature/date_bin_update
| Time32(array_type), | ||
| Time32(array_type), |
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.
Could you explain why for time we require the expression & origin arguments to have the same granularity in terms of time units, whereas for timestamps above we seem to always have origin as Nanoseconds regardless of the expression granularity?
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.
It didn't occur to me essentially :/
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 took a look at this and it's a bit more than just the timeunit - it's the type. For time32 there is just two timeunits supported - Second and Millisecond. For Time64 it's Microsecond and Nanosecond.
Supporting a mix of those I think would be unnecessary. Forcing a single type (Time64(Nanosecond)) might work but I don't see it as beneficial really. Are you of a different opinion?
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 was more thinking of trying to simplify the signature (which looks a bit gnarly) and potentially the implementation too. In terms of actual functionality it should be fine.
Which issue does this PR close?
Part of #19025
Rationale for this change
Expand support for binning time data types.
What changes are included in this PR?
Code, tests.
Are these changes tested?
Yes, slt tests.
Are there any user-facing changes?
No.