wgtmac commented on code in PR #48692:
URL: https://github.com/apache/arrow/pull/48692#discussion_r2666934859


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -2076,7 +2076,10 @@ Status 
TypedColumnWriterImpl<ParquetType>::WriteArrowSerialize(
   PARQUET_THROW_NOT_OK(ctx->GetScratchData<ParquetCType>(array.length(), 
&buffer));
 
   SerializeFunctor<ParquetType, ArrowType> functor;
-  RETURN_NOT_OK(functor.Serialize(checked_cast<const ArrayType&>(array), ctx, 
buffer));
+  // The value buffer could be empty if all values are nulls.
+  if (array.null_count() != array.length()) {

Review Comment:
   In case of an invalid arrow array, value buffer can still be nullptr when 
`array.null_count() == array.length()` which crashes the following call.



-- 
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]

Reply via email to