-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
GH-37110: [C++] Expression: SmallestTypeFor lost tz for Scalar #37135
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.
Nice catch, @mapleFU ! LGTM but just a suggestion.
cmp(field_ref("ts_s"), | ||
literal(std::make_shared<TimestampScalar>(0, TimeUnit::NANO, "UTC"))), | ||
cmp(field_ref("ts_s"), | ||
literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND, "UTC")))); |
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.
Since we are at it and the original PR didn't add many tests, can we also test non-zero values? For example (untested):
literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND, "UTC")))); | |
literal(std::make_shared<TimestampScalar>(0, TimeUnit::SECOND, "UTC")))); | |
ExpectBindsTo( | |
cmp(field_ref("ts_s"), | |
literal(std::make_shared<TimestampScalar>(123000, TimeUnit::NANO, "UTC"))), | |
cmp(field_ref("ts_s"), | |
literal(std::make_shared<TimestampScalar>(123, TimeUnit::MICRO, "UTC")))); |
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.
Added, I also found that we need a UTC type here.
field("ts_s_utc", timestamp(TimeUnit::SECOND, "UTC"))
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit baf3eb9. There were 2 benchmark results indicating a performance regression:
The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
Great find! |
…pache#37135) ### Rationale for this change This patch ( apache#15180 ) adds a `SmallestTypeFor` to handling expression type. However, it lost timezone when handling. ### What changes are included in this PR? Add `timezone` in `SmallestTypeFor` ### Are these changes tested? Currently not ### Are there any user-facing changes? Yeah it's a bugfix * Closes: apache#37110 Authored-by: mwish <maplewish117@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Rationale for this change
This patch ( #15180 ) adds a
SmallestTypeFor
to handling expression type. However, it lost timezone when handling.What changes are included in this PR?
Add
timezone
inSmallestTypeFor
Are these changes tested?
Currently not
Are there any user-facing changes?
Yeah it's a bugfix