HuaHuaY commented on code in PR #55136:
URL: https://github.com/apache/arrow/pull/55136#discussion_r4375580667
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -3262,6 +3262,46 @@ TEST(ArrowReadWrite, NestedRequiredField) {
/*row_group_size=*/8);
}
+TEST(ArrowReadWrite, NestedRequiredFieldWithMaskedNulls) {
+ auto type =
+ ::arrow::struct_({::arrow::field("inner", ::arrow::int32(),
/*nullable=*/false)});
+ auto values = ::arrow::ArrayFromJSON(type, R"([{"inner": 42}])");
+ auto indices = ::arrow::ArrayFromJSON(::arrow::int32(), "[0, 0, null, 0]");
+ ASSERT_OK_AND_ASSIGN(auto array, ::arrow::compute::Take(*values, *indices));
Review Comment:
> It's not obvious why the test is using Take, is it relying on an
implementation detail of Take to have nulls in the top-level and nested bitmaps?
Yes. I chose `Take` to demonstrate how this input can arise in real
workloads, where both top-level and nested bitmaps might contain `null` values.
> If so, can we rewrite it to be more reliable?
Do you mean assembling the required array manually, without relying on
`Take`?
--
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]