Uh oh!
There was an error while loading. Please reload this page.
[fix](orc) decode timestamp through serde - #64807
Conversation
hello-stephen
commented
Jun 25, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
- remove the ORC leaf-type decode switch from `OrcReader::_fill_doris_data_column` - add `DataTypeSerDe::read_column_from_orc` implementations for ORC leaf types produced by the reader: numeric, decimal, datev2, string, varbinary, datetimev2, and timestamptz - keep ARRAY/MAP/STRUCT traversal in ORC serde/context while nested leaf values are decoded through their nested type serde - fix ORC timestamp and nested timestamp decoding so nanoseconds are truncated to the target timestamp scale before string/predicate evaluation - fix ORC DECIMALV2 decode to rescale file values into the fixed in-memory scale 9 representation - preserve ORC CHAR trimming based on ORC physical CHAR type only (cherry picked from commit fcffadc)
3074203 to
18dd1c4Comparexylaaaaa
commented
Jul 8, 2026
run buildall |
hello-stephen
commented
Jul 8, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jul 8, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
xylaaaaa
commented
Jul 9, 2026
run beut |
xylaaaaa
commented
Jul 9, 2026
run p0 |
xylaaaaa
commented
Jul 9, 2026
run nonConcurrent |
hello-stephen
commented
Jul 9, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jul 9, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jul 9, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Jul 9, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
Proposed changes
Fix ORC timestamp decoding to round nanoseconds to Doris microseconds instead of truncating them. This keeps
CAST(timestamp AS VARCHAR)aligned with Hive/Trino prefix expectations for values like2020-01-02 03:04:05.321.The same decode path is used by nested timestamps in array/map/struct columns, so this also covers complex type projections.
Problem summary
ORC stores timestamp fractional seconds as nanoseconds, while Doris
DATETIMEV2(6)keeps microseconds. The previous conversion truncated nanos with/ 1000, so an ORC value such as320999999nsbecame.320999instead of.321000. Prefix predicates like:could therefore miss rows created by Hive/Trino ORC writers.
Solution
999999500nsand above into the next second.TIMESTAMPandTIMESTAMP_INSTANTdecode paths.Test plan
ninja -j 8 doris_be_test./be/ut_build_RELEASE/test/doris_be_test --gtest_filter='OrcReaderFillDataTest.TestTimestampNanosecondsRoundToMicroseconds'./be/ut_build_RELEASE/test/doris_be_test --gtest_filter='OrcReaderFillDataTest.*'git diff --check