lxy-9602 commented on code in PR #207:
URL: https://github.com/apache/paimon-cpp/pull/207#discussion_r3788277706
##########
src/paimon/format/parquet/page_filtered_row_group_reader.cpp:
##########
@@ -397,12 +397,14 @@ Result<std::unique_ptr<arrow::RecordBatchReader>>
PageFilteredRowGroupReader::Re
std::vector<std::shared_ptr<arrow::ChunkedArray>> result_arrays;
result_arrays.reserve(field_indices.size());
+ std::shared_ptr<std::unordered_set<int>> col_indices_set(new
std::unordered_set<int>());
+ col_indices_set->insert(column_indices.begin(), column_indices.end());
// TODO(zhouhongfeng.zhf): This loop could be parallelized.
Review Comment:
use `std::make_shared<std::unordered_set<int>>`
##########
src/paimon/format/parquet/page_filtered_row_group_reader.cpp:
##########
@@ -397,12 +397,14 @@ Result<std::unique_ptr<arrow::RecordBatchReader>>
PageFilteredRowGroupReader::Re
std::vector<std::shared_ptr<arrow::ChunkedArray>> result_arrays;
result_arrays.reserve(field_indices.size());
+ std::shared_ptr<std::unordered_set<int>> col_indices_set(new
std::unordered_set<int>());
+ col_indices_set->insert(column_indices.begin(), column_indices.end());
// TODO(zhouhongfeng.zhf): This loop could be parallelized.
Review Comment:
Could we pass `const std::unordered_set<int>&` to `GetReader()` instead? The
set is only queried while synchronously building the reader tree, so
`ReaderContext` does not need to own it. This also avoids `shared_ptr`
allocation/ref-counting and expresses read-only access. If minimizing changes,
consider at least using `std::shared_ptr<const std::unordered_set<int>>`.
--
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]