Repository navigation
[fix](arrow) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types - #48944
Merged
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
xinyiZzz
force-pushed
the
20250303_fix_arrow_ut
branch
from
March 12, 2025 13:56
8143fe2 to
e5e2832
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33678 ms |
TPC-DS: Total hot run time: 192426 ms |
ClickBench: Total hot run time: 30.88 s |
xinyiZzz
force-pushed
the
20250303_fix_arrow_ut
branch
from
March 13, 2025 05:27
e5e2832 to
628405c
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33498 ms |
TPC-DS: Total hot run time: 185610 ms |
ClickBench: Total hot run time: 30.95 s |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 32496 ms |
TPC-DS: Total hot run time: 185474 ms |
ClickBench: Total hot run time: 30.82 s |
xinyiZzz
force-pushed
the
20250303_fix_arrow_ut
branch
from
March 14, 2025 07:42
1116ea0 to
5370b6f
Compare
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 33175 ms |
TPC-DS: Total hot run time: 185054 ms |
ClickBench: Total hot run time: 30.79 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 32457 ms |
TPC-DS: Total hot run time: 190508 ms |
ClickBench: Total hot run time: 31.22 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
xinyiZzz
added a commit
to xinyiZzz/incubator-doris
that referenced
this pull request
Mar 19, 2025
…/HLL/Decimal256 types (apache#48944) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types. TODO: 1. Map and Struct types `deserialize_one_cell_from_json` has Bug, which makes some cases unable to be tested by the framework. cannot test Struct type nested Array and Map and Struct, so manually construct data to test them. scalar type can be covered in the `data_type_serde_arrow_test`. 2. Bitmap and HLL types only support Doris Column serialization to Arrow, but not deserialization. Currently, only ArrowReader of Data Lake uses deserialization Arrow -> Doris.
16 tasks
xinyiZzz
added a commit
to xinyiZzz/incubator-doris
that referenced
this pull request
Mar 28, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (apache#49244) pick apache#48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types pick apache#48398 [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
16 tasks
xinyiZzz
added a commit
to xinyiZzz/incubator-doris
that referenced
this pull request
Apr 30, 2025
…of Date/Datetime/Array/Map/Struct/Bitmap/HLL/Decimal256 types (apache#49244) pick apache#48944 [fix](arrow) Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types pick apache#48398 [fix](arrow) Fix UT DataTypeSerDeArrowTest of Date type
koarz
pushed a commit
to koarz/doris
that referenced
this pull request
Jun 4, 2025
…/HLL/Decimal256 types (apache#48944) ### What problem does this PR solve? Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types. TODO: 1. Map and Struct types `deserialize_one_cell_from_json` has Bug, which makes some cases unable to be tested by the framework. cannot test Struct type nested Array and Map and Struct, so manually construct data to test them. scalar type can be covered in the `data_type_serde_arrow_test`. 2. Bitmap and HLL types only support Doris Column serialization to Arrow, but not deserialization. Currently, only ArrowReader of Data Lake uses deserialization Arrow -> Doris.
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 25, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 26, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 27, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 28, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 29, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Oct 31, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Nov 2, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
morningman
added a commit
to morningman/doris
that referenced
this pull request
Nov 5, 2026
### What problem does this PR solve? Issue Number: None Related PR: apache#69581, apache#68649 Problem Summary: Reproduction: read an Arrow Date32 array holding a day outside 0000-01-01..9999-12-31 into a Doris DATE column, for example 2932897 (10000-01-01) written by PyArrow into a Lance dataset, or the same value returned by an ADBC driver, an Arrow stream load or the paimon-rust reader. The row comes back as a non-null `0000-00-00`, also inside ARRAY, STRUCT and MAP values. Root cause: the DATE32 branch of the shared `DataTypeDateV2SerDe::read_column_from_arrow` ignores the bool returned by `get_date_from_daynr()` (dropped since apache#48944) and appends the default-constructed value. It also adds the epoch offset in 32 bits, so INT32_MAX overflows, and it decodes the payload of NULL slots. The DATE64 branch next to it already rejects out-of-range days. Fix: port the DATE32 range part of the branch-4.1/4.2 fix apache#68649. NULL slots append the default value without being decoded, the day number is computed in 64 bits, and a day number <= 0, above DATE_MAX_DAYNR or rejected by `get_date_from_daynr()` returns `InvalidArgument("Arrow Date32 value is outside the Doris DATE range: row=..., days=...")` with the 4.x wording. ARRAY/STRUCT/MAP leaves get the same check through their element SerDes. `write_column_to_arrow` and the year-zero calendar mapping (the other part of apache#68649, and master draft apache#67449) are unchanged; the new tests avoid the days whose meaning that mapping changes. Before: out-of-range days read as `0000-00-00`. After: the read fails with the error above; in-range values and NULLs read as before. The Lance reader ported in apache#69581 (from the branch-4.2 snapshot, which already contains apache#68649) relies on this SerDe check. ### Release note Reading Arrow DATE32 values outside 0000-01-01..9999-12-31 (ADBC, Arrow stream load, paimon-rust, Lance) now fails instead of returning 0000-00-00. ### Check List (For Author) - Test: Unit Test - New: `DataTypeDateTimeV2SerDeTest.RejectsInvalidDate32Values`, `LanceTableReaderTypeTest.RejectsDate32OutsideDorisDateRange`, `LanceTableReaderTypeTest.ReadsLastDorisDateAndIgnoresNullDate32Payload`. - All pass on macOS arm64 (ASAN), together with `DataTypeDateTimeV2SerDeTest.*`, `DataTypeSerDeArrowTest.*`, `DataTypeSerDeArrowValidationTest.*`, `ArrowColumnToDorisColumnTest.*`, `ParquetExprTest.*`, `IcebergV2ReaderTest.*` and the Lance suites. With master's DATE32 branch restored, the first two fail. - `DataTypeDateTimeV2SerDeTest` aborts in its setup under macOS ASAN on master: `load_data_from_csv()` in `be/test/testutil/test_util.cpp` dereferences `std::set::end()`. It ran here with that assertion removed locally; that fix goes in a separate PR. - Behavior changed: Yes. An Arrow DATE32 day outside 0000-01-01..9999-12-31 used to be returned as a non-null 0000-00-00; the scan now fails with an InvalidArgument error, as Arrow DATE64 values already did. - Does this need documentation: No Co-authored-by: Gabriel <[email protected]> Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Fix UT DataTypeSerDeArrowTest of Array/Map/Struct/Bitmap/HLL/Decimal256 types.
TODO:
deserialize_one_cell_from_jsonhas Bug, which makes some cases unable to be tested by the framework. cannot test Struct type nested Array and Map and Struct, so manually construct data to test them. scalar type can be covered in thedata_type_serde_arrow_test.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)