wgtmac commented on code in PR #37003:
URL: https://github.com/apache/arrow/pull/37003#discussion_r1349858700
##########
cpp/src/parquet/file_reader.h:
##########
@@ -58,6 +62,10 @@ class PARQUET_EXPORT RowGroupReader {
// column. Ownership is shared with the RowGroupReader.
std::shared_ptr<ColumnReader> Column(int i);
+ // Construct a RecordReader for the indicated row group-relative column i.
+ // Ownership is shared with the RowGroupReader.
Review Comment:
Or it would be good to explicitly let user know the return type is an
internal class.
##########
cpp/src/parquet/file_reader.h:
##########
@@ -58,6 +62,10 @@ class PARQUET_EXPORT RowGroupReader {
// column. Ownership is shared with the RowGroupReader.
std::shared_ptr<ColumnReader> Column(int i);
+ // Construct a RecordReader for the indicated row group-relative column i.
+ // Ownership is shared with the RowGroupReader.
Review Comment:
```suggestion
// EXPERIMENTAL: Construct a RecordReader for the indicated column of the
row group.
// Ownership is shared with the RowGroupReader.
```
##########
cpp/src/parquet/reader_test.cc:
##########
@@ -502,6 +502,66 @@ TEST_F(TestAllTypesPlain, ColumnSelectionOutOfRange) {
ASSERT_THROW(printer2.DebugPrint(ss, columns), ParquetException);
}
+// Tests that read_dense_for_nullable is passed down to the record
+// reader. The functionality of read_dense_for_nullable is tested
+// elsewhere.
+TEST(TestFileReader, RecordReaderReadDenseForNullable) {
+ // Default is false.
Review Comment:
Can we use a vector of ReaderProperties to reduce repeated code? For example,
```cpp
std::vector<ReaderProperties> reader_properties(3);
reader_properties[1].enable_read_dense_for_nullable();
reader_properties[2].enable_read_dense_for_nullable();
reader_properties[2].disable_read_dense_for_nullable();
for (const auto& reader_props : reader_properties) {
std::unique_ptr<ParquetFileReader> file_reader =
ParquetFileReader::OpenFile(
alltypes_plain(), /* memory_map = */ false, reader_props);
std::shared_ptr<RowGroupReader> group = file_reader->RowGroup(0);
std::shared_ptr<internal::RecordReader> col_record_reader =
group->RecordReader(0);
ASSERT_EQ(reader_props.read_dense_for_nullable(),
col_record_reader->read_dense_for_nullable());
}
```
--
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]