Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support read row group from packed reader #157

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shaoting-huang
Copy link
Collaborator

@shaoting-huang shaoting-huang commented Dec 19, 2024

related: #158

@sre-ci-robot sre-ci-robot requested review from sunby and tedxu December 19, 2024 09:56
@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shaoting-huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

const std::string& path,
const std::shared_ptr<arrow::Schema> schema,
const size_t start_row_group,
const size_t end_row_group,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not easy to know if the end_row_group is inclusive or not.

@@ -57,9 +67,19 @@ class PackedRecordBatchReader : public arrow::RecordBatchReader {

arrow::Status ReadNext(std::shared_ptr<arrow::RecordBatch>* batch) override;

Result<std::shared_ptr<arrow::Table>> ReadRowGroup(int file_index, int row_group_index);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function seems not necessary.

@@ -70,6 +90,8 @@ class PackedRecordBatchReader : public arrow::RecordBatchReader {
size_t memory_limit_;
size_t buffer_available_;
std::vector<std::unique_ptr<parquet::arrow::FileReader>> file_readers_;
std::vector<size_t> start_row_groups_;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be much cleaner if these attributes go to some FileRecordBatchReader, because they make no sense in packed scenarios.

std::vector<ColumnOffset>(),
std::set<int>(),
std::vector<size_t>(1, start_row_group),
std::vector<size_t>(1, end_row_group),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validity check required for the two arguments.

Signed-off-by: shaoting-huang <[email protected]>
Signed-off-by: shaoting-huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants