pitrou commented on code in PR #15182:
URL: https://github.com/apache/arrow/pull/15182#discussion_r1067250353
##########
cpp/src/parquet/reader_test.cc:
##########
@@ -1015,4 +1019,44 @@ INSTANTIATE_TEST_SUITE_P(Lz4CodecTests, TestCodec,
::testing::ValuesIn(test_code
testing::PrintToStringParamName());
#endif // ARROW_WITH_LZ4
+// Test reading a data file with a ColumnChunk contains more than
+// INT16_MAX pages. (GH-15074).
+TEST(TestFileReader, TestOverflowInt16PageOrdinal) {
+ ReaderProperties reader_props;
+ auto file_reader = ParquetFileReader::OpenFile(overflow_i16_page_oridinal(),
+ /*memory_map=*/false,
reader_props);
+ auto metadata_ptr = file_reader->metadata();
+ EXPECT_EQ(1, metadata_ptr->num_row_groups());
+ EXPECT_EQ(1, metadata_ptr->num_columns());
+ auto row_group = file_reader->RowGroup(0);
+
+ {
+ auto column_reader =
+
std::dynamic_pointer_cast<TypedColumnReader<BooleanType>>(row_group->Column(0));
+ EXPECT_NE(nullptr, column_reader);
+ constexpr int kBatchLength = 1024;
+ std::array<bool, kBatchLength> boolean_values{};
+ int64_t value_sum = 0;
+ int64_t value_num = 0;
Review Comment:
Suggesting better names for these
```suggestion
int64_t total_values = 0;
int64_t values_read = 0;
```
--
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]