Skip to content

DX-110851 Truncate subseconds beyond milliseconds in castTIMESTAMP_utf8 and castTIME_utf8#114

Merged
akravchukdremio merged 1 commit intodremio:dremio_27.0_20from
akravchukdremio:DX-110851
Jan 30, 2026
Merged

DX-110851 Truncate subseconds beyond milliseconds in castTIMESTAMP_utf8 and castTIME_utf8#114
akravchukdremio merged 1 commit intodremio:dremio_27.0_20from
akravchukdremio:DX-110851

Conversation

@akravchukdremio
Copy link
Copy Markdown

@akravchukdremio akravchukdremio commented Jan 29, 2026

Cherry-pick of apache@08175e5 commit from merged OSS PR: apache#48867 in arrow repo


The Gandiva precompiled time functions castTIMESTAMP_utf8 and castTIME_utf8 currently 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.

Changes:

  • Fixed castTIMESTAMP_utf8 and castTIME_utf8 functions to truncate subseconds beyond 3 digits instead of throwing an error
  • Updated tests. Replaced error-expecting tests with truncation verification tests and added edge cases

…s in `castTIMESTAMP_utf8` and `castTIME_utf8` (apache#48867)

### Rationale for this change

Fixes apache#48866. The Gandiva precompiled time functions `castTIMESTAMP_utf8` and `castTIME_utf8` currently 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?

- Fixed `castTIMESTAMP_utf8` and `castTIME_utf8` functions to truncate subseconds beyond 3 digits instead of throwing an error
- Updated tests. Replaced error-expecting tests with truncation verification tests and added edge cases

### Are these changes tested?

Yes

### Are there any user-facing changes?

No
* GitHub Issue: apache#48866

Authored-by: Arkadii Kravchuk <arkadii.kravchuk@dremio.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@akravchukdremio akravchukdremio self-assigned this Jan 29, 2026
@akravchukdremio akravchukdremio merged commit 3b47de3 into dremio:dremio_27.0_20 Jan 30, 2026
7 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants