wgtmac commented on code in PR #55862:
URL: https://github.com/apache/arrow/pull/55862#discussion_r4748643898
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -2702,12 +2691,19 @@ Status TypedColumnWriterImpl<FLBAType>::WriteArrowDense(
const int16_t* def_levels, const int16_t* rep_levels, int64_t num_levels,
const ::arrow::Array& array, ArrowWriteContext* ctx, bool
maybe_parent_nulls) {
switch (array.type()->id()) {
- WRITE_SERIALIZE_CASE(FIXED_SIZE_BINARY)
WRITE_SERIALIZE_CASE(DECIMAL32)
WRITE_SERIALIZE_CASE(DECIMAL64)
WRITE_SERIALIZE_CASE(DECIMAL128)
WRITE_SERIALIZE_CASE(DECIMAL256)
WRITE_SERIALIZE_CASE(HALF_FLOAT)
+ case ::arrow::Type::FIXED_SIZE_BINARY: {
+ if (const auto& binary = checked_cast<const
::arrow::FixedSizeBinaryArray&>(array);
+ binary.byte_width() != descr_->type_length()) {
+ return Status::Invalid("Unexpected fixed-size binary width: ",
+ binary.byte_width(), ", expected ",
descr_->type_length());
+ }
+ return WriteArrowBinary(def_levels, rep_levels, num_levels, array, ctx);
Review Comment:
A batch of empty lists can produce a zero-length `FixedSizeBinaryArray` with
no values buffer. The PLAIN and BYTE_STREAM_SPLIT array overloads then pass a
null source to memcpy, which is undefined even for a zero-byte copy. It looks
like a regression from this PR.
--
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]