wgtmac commented on code in PR #44921:
URL: https://github.com/apache/arrow/pull/44921#discussion_r1868570496
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1301,6 +1301,10 @@ class TypedColumnWriterImpl : public ColumnWriterImpl,
public TypedColumnWriter<
bool single_nullable_element =
(level_info_.def_level == level_info_.repeated_ancestor_def_level + 1)
&&
leaf_field_nullable;
+ if (!leaf_field_nullable && leaf_array.null_count() != 0) {
Review Comment:
I just found that `Array::Validate()` and `Array::ValidateFull()` are
checking `DataType` not `Field`. If it knows the latter, we can also validate
null_count with nullable from that Field.
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1301,6 +1301,10 @@ class TypedColumnWriterImpl : public ColumnWriterImpl,
public TypedColumnWriter<
bool single_nullable_element =
(level_info_.def_level == level_info_.repeated_ancestor_def_level + 1)
&&
leaf_field_nullable;
+ if (!leaf_field_nullable && leaf_array.null_count() != 0) {
Review Comment:
Should we take special care when it is `kUnknownNullCount`? It is possible
for an end user to produce an array without setting a precise null_count 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]