-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-48866: [C++][Gandiva] Truncate subseconds beyond milliseconds in castTIMESTAMP_utf8 and castTIME_utf8
#48867
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
base: main
Are you sure you want to change the base?
Conversation
|
|
|
@kou Could you plz take a look? |
cpp/src/gandiva/precompiled/time.cc
Outdated
| // Truncate to 3 digits (milliseconds precision) if more digits are provided | ||
| while (sub_seconds_len > 3) { | ||
| ts_fields[TimeFields::kSubSeconds] /= 10; | ||
| sub_seconds_len--; | ||
| } |
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.
Can we factor out this common code?
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 for review, moved common code in the separate inline function
|
@xxlaykxx Could you also review this? We don't have enough maintainers for Gandiva. |
|
@akravchukdremio Could you rebase on main to fix CI failures? |
5aac113 to
3d7ef89
Compare
Sure, rebased PR |
…s in `castTIMESTAMP_utf8` and `castTIME_utf8`
3d7ef89 to
b818113
Compare
Rationale for this change
Fixes #48866. The Gandiva precompiled time functions
castTIMESTAMP_utf8andcastTIME_utf8currently reject timestamp and time string literals with more than 3 subsecond digits (beyond millisecond precision), throwing an "Invalid millis" error. This behavior is inconsistent with other implementations.What changes are included in this PR?
castTIMESTAMP_utf8andcastTIME_utf8functions to truncate subseconds beyond 3 digits instead of throwing an errorAre these changes tested?
Yes
Are there any user-facing changes?
No
castTIMESTAMP_utf8andcastTIME_utf8should truncate subseconds beyond milliseconds, not reject them #48866