westonpace commented on code in PR #36192:
URL: https://github.com/apache/arrow/pull/36192#discussion_r1243936260
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -2382,6 +2382,38 @@ TEST(TestArrowReadWrite, WaitCoalescedReads) {
ASSERT_EQ(actual_batch->num_rows(), num_rows);
}
+// Use coalesced reads and non-coaleasced reads for different column chunks.
+TEST(TestArrowReadWrite, CoalescedReadsAndNonCoalescedReads) {
+ constexpr int num_columns = 5;
+ constexpr int num_rows = 128;
+
+ std::shared_ptr<Table> expected;
+ ASSERT_NO_FATAL_FAILURE(
+ MakeDoubleTable(num_columns, num_rows, /*nchunks=*/1, &expected));
+
+ std::shared_ptr<Buffer> buffer;
+ ASSERT_NO_FATAL_FAILURE(WriteTableToBuffer(expected, num_rows / 2,
+
default_arrow_writer_properties(), &buffer));
+
+ std::unique_ptr<FileReader> reader;
+ ASSERT_OK_NO_THROW(OpenFile(std::make_shared<BufferReader>(buffer),
+ ::arrow::default_memory_pool(), &reader));
+
+ ASSERT_EQ(2, reader->num_row_groups());
+
+ // Pre-buffer 3 columns in the 2nd row group.
+ const std::vector<int> row_groups = {1};
+ const std::vector<int> column_indices = {0, 1, 4};
+ reader->parquet_reader()->PreBuffer(row_groups, column_indices,
+ ::arrow::io::IOContext(),
+ ::arrow::io::CacheOptions::Defaults());
+ ASSERT_OK(reader->parquet_reader()->WhenBuffered(row_groups,
column_indices).status());
+
+ ASSERT_OK_AND_ASSIGN(auto actual, ReadTableManually(reader.get()));
Review Comment:
Does ReadTableManually read the entire table?
--
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]