chrisavl commented on a change in pull request #8589:
URL: https://github.com/apache/arrow/pull/8589#discussion_r520225236
##########
File path: cpp/src/parquet/arrow/arrow_reader_writer_test.cc
##########
@@ -3199,6 +3200,36 @@ TEST(TestArrowReaderAdHoc, HandleDictPageOffsetZero) {
TryReadDataFile(test::get_data_file("dict-page-offset-zero.parquet"));
}
+TEST(TestArrowReaderAdHoc, WriteBatchedNestedNullableStringColumn) {
+ // ARROW-10493
+ auto type =
+ ::arrow::struct_({::arrow::field("inner", ::arrow::utf8(),
/*nullable=*/true)});
+ auto outer_array = ::arrow::ArrayFromJSON(type,
+ R"([{"inner": "a"},
+ {"inner": null},
+ {"inner": "b"},
+ {"inner": "c"},
+ {"inner": null},
+ {"inner": null},
+ {"inner": "d"},
+ null])");
+ auto inner_array =
+ std::static_pointer_cast<::arrow::StructArray>(outer_array)->field(0);
+ ASSERT_OK_AND_ASSIGN(inner_array->data()->buffers[0],
+ ::arrow::internal::BytesToBits({1, 0, 1, 1, 0, 0, 1,
0}));
+ ASSERT_OK_AND_ASSIGN(outer_array->data()->buffers[0],
+ ::arrow::internal::BytesToBits({1, 1, 1, 1, 1, 1, 1,
0}));
Review comment:
Thanks, I got confused by the validity of the inner array being 1 when
the outer array validity is 0 for the last element. But this is not actually
relevant to this issue, so I will just remove this bit of code.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]