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


##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -5370,12 +5370,53 @@ TEST_F(ParquetPageIndexRoundTripTest, 
SimpleRoundTripWithStatsDisabled) {
       [6,     "f",  null     ]
     ])"}));
 
-  ReadPageIndexes(/*expect_num_row_groups=*/2, /*expect_num_pages=*/1);
+  ReadPageIndexes(/*expect_num_row_groups=*/1, /*expect_num_pages=*/1);
   for (auto& column_index : column_indexes_) {
     EXPECT_TRUE(column_index.empty);
   }
 }
 
+TEST_F(ParquetPageIndexRoundTripTest, SimpleRoundTripWithColumnStatsDisabled) {
+  auto writer_properties = WriterProperties::Builder()
+                               .enable_write_page_index()
+                               ->disable_statistics("c0")
+                               ->max_row_group_length(4)
+                               ->build();
+  auto schema = ::arrow::schema({::arrow::field("c0", ::arrow::int64()),
+                                 ::arrow::field("c1", ::arrow::utf8()),
+                                 ::arrow::field("c2", 
::arrow::list(::arrow::int64()))});
+  WriteFile(writer_properties, ::arrow::TableFromJSON(schema, {R"([
+      [1,     "a",  [1]      ],
+      [2,     "b",  [1, 2]   ],
+      [3,     "c",  [null]   ],
+      [null,  "d",  []       ],
+      [5,     null, [3, 3, 3]],
+      [6,     "f",  null     ]
+    ])"}));
+
+  ReadPageIndexes(/*expect_num_row_groups=*/2, /*expect_num_pages=*/1);
+
+  ColumnIndexObject empty_column_index{};
+  empty_column_index.empty = true;
+  EXPECT_THAT(
+      column_indexes_,
+      ::testing::ElementsAre(
+          empty_column_index,

Review Comment:
   That seems duplicate. A valid ColumnIndex must have at least one page. So 
`null_pages`, `min_values` and `max_values` will not be empty and share the 
same size if ColumnIndexObject is created from a non null ColumnIndex.



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