hello-stephen commented on code in PR #71142:
URL: https://github.com/apache/doris/pull/71142#discussion_r4737336657
##########
be/src/format_v2/arrow/arrow_stream_reader.cpp:
##########
@@ -489,12 +554,15 @@ Status ArrowStreamReader::_next_batch() {
return Status::OK();
}
}
- RETURN_DORIS_STATUS_IF_ERROR(_ipc_reader->ReadNext(&_batch));
- if (!_batch) {
+ std::shared_ptr<arrow::RecordBatch> batch;
+ RETURN_DORIS_STATUS_IF_ERROR(_ipc_reader->ReadNext(&batch));
+ if (!batch) {
_ipc_reader.reset();
continue;
}
- RETURN_DORIS_STATUS_IF_ERROR(_batch->Validate());
+ // Validate every array before normalization or materialization reads
its buffers.
+ RETURN_DORIS_STATUS_IF_ERROR(batch->ValidateFull());
Review Comment:
[P2] Mask hidden descendants before full value validation
The new `RejectsInvalidDate64InNullList` fixture logically contains `[NULL,
[1970-01-02]]`: its DATE64 value `1` belongs only to the NULL list's child
segment. The [Arrow format
contract](https://github.com/apache/arrow/blob/apache-arrow-24.0.0/docs/source/format/Columnar.rst#L506-L508)
permits arbitrary content in that segment. However, `ValidateFull()`
recursively validates the entire child array and rejects `1` before
`_prepare_arrays()` can propagate the ancestor NULL. This makes a previously
accepted logical batch fail the load; the new test currently codifies that
regression. Keep structural/buffer/offset checks before buffer access, then
mask or compact hidden descendants before semantic value validation, as
`compact_lance_array()` already does. The NULL-list fixture should succeed,
with a separate negative case for a visible invalid DATE64 value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]