AnuragRaut08 commented on code in PR #51357:
URL: https://github.com/apache/arrow/pull/51357#discussion_r4053401976


##########
cpp/src/parquet/arrow/arrow_statistics_test.cc:
##########
@@ -160,6 +160,50 @@ INSTANTIATE_TEST_SUITE_P(
             /*expected_min=*/"z",
             /*expected_max=*/"z"}));
 
+TEST(StatisticsTest, FixedWidthLeafUnderListStructNullCount) {
+  // Null counts for fixed-width leaves under list<struct<...>>
+  // must include null and empty list entries from the repeated ancestor.
+  auto schema = ::arrow::schema({::arrow::field(
+      "col", ::arrow::list(::arrow::struct_(
+                    {::arrow::field("s", ::arrow::utf8()),
+                     ::arrow::field("i32", ::arrow::int32())})))});
+
+  auto table = Table::Make(
+      schema,
+      {ArrayFromJSON(
+          schema->field(0)->type(),
+          
R"([[{"s":"a","i32":1}],null,[],[{"s":null,"i32":null},{"s":"b","i32":2}]])")});
+
+  std::shared_ptr<::arrow::ResizableBuffer> serialized_data = AllocateBuffer();
+  auto out_stream =
+      std::make_shared<::arrow::io::BufferOutputStream>(serialized_data);
+
+  ASSERT_OK_AND_ASSIGN(
+      std::unique_ptr<FileWriter> writer,
+      FileWriter::Open(*schema, default_memory_pool(), out_stream,
+                       default_writer_properties(),
+                       default_arrow_writer_properties()));
+  ASSERT_OK(writer->WriteTable(*table, std::numeric_limits<int64_t>::max()));
+  ASSERT_OK(writer->Close());
+  ASSERT_OK(out_stream->Close());
+
+  auto buffer_reader = 
std::make_shared<::arrow::io::BufferReader>(serialized_data);
+  auto parquet_reader = ParquetFileReader::Open(std::move(buffer_reader));
+  auto metadata = parquet_reader->metadata();
+  auto row_group = metadata->RowGroup(0);
+
+  ASSERT_EQ(row_group->num_columns(), 2);

Review Comment:
   Done. Applied the suggested formatting cleanup.



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