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

GH-37002: [C++][Parquet] Add api to get RecordReader from RowGroupReader #37003

Merged
merged 10 commits into from
Oct 17, 2023

Conversation

fatemehp
Copy link
Contributor

@fatemehp fatemehp commented Aug 3, 2023

Currently we only can get a ColumnReader for a column from RowGroupReader. We need an API to return a RecordReader for the column.

Moved ComputeLevelInfo from column_writer to level_conversion so that it can be shared between column_writer and file_reader.

@fatemehp fatemehp requested a review from wgtmac as a code owner August 3, 2023 00:10
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

In the case of PARQUET issues on JIRA the title also supports:

PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

See also:

Copy link
Member

@mapleFU mapleFU left a comment

Choose a reason for hiding this comment

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

I'm generally ok with this patch. Would you mind add GH-37002 as a prefix?

cpp/src/parquet/file_reader.h Outdated Show resolved Hide resolved
@@ -58,6 +59,11 @@ 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.
std::shared_ptr<internal::RecordReader> RecordReader(
Copy link
Member

Choose a reason for hiding this comment

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

Emm I'm ok with the logic here, but is it ok to expose internal:: logic?

Copy link
Member

Choose a reason for hiding this comment

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

I doubt tests checking exposure of internal namespace will complain about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably should remove the RecordReader from the internal namespace at some point. I am not sure how that is decided.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with moving it out of the internal namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I think it is better to remove the internal namespace in a separate pull request.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @fatemehp . Should we first remove internal, then work on this patch? Or you'd like to let us check this first?

After checking I think maybe we can remove internal. cc @pitrou @wgtmac

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer to check this in first.

Copy link
Member

Choose a reason for hiding this comment

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

IMHO, I'd prefer to move RecordReader out of internal namespace first. Because we can know the consequence of namespace change before exposing it.

cpp/src/parquet/file_reader.cc Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Aug 3, 2023
@wgtmac wgtmac changed the title [C++][Parquet] Add api to get RecordReader from RowGroupReader. #37002 GH-37002: [C++][Parquet] Add api to get RecordReader from RowGroupReader Aug 3, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

⚠️ GitHub issue #37002 has been automatically assigned in GitHub to PR creator.

cpp/src/parquet/file_reader.h Outdated Show resolved Hide resolved
cpp/src/parquet/file_reader.h Outdated Show resolved Hide resolved
@@ -58,6 +59,11 @@ 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.
std::shared_ptr<internal::RecordReader> RecordReader(
Copy link
Member

Choose a reason for hiding this comment

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

IMHO, I'd prefer to move RecordReader out of internal namespace first. Because we can know the consequence of namespace change before exposing it.

@mapleFU
Copy link
Member

mapleFU commented Aug 23, 2023

I've check the codebase and find somewhere export the internal in .h, so here look good to me if other issue fixed @fatemehp

@mapleFU
Copy link
Member

mapleFU commented Sep 12, 2023

ping @fatemehp , would we move forward?

@fatemehp
Copy link
Contributor Author

fatemehp commented Oct 3, 2023

I am sorry I got distracted for a while. I will make the changes requested and update here. @mapleFU are you suggesting that it is not necessary to remove the internal namespace?

cpp/src/parquet/file_reader.h Outdated Show resolved Hide resolved
cpp/src/parquet/reader_test.cc Outdated Show resolved Hide resolved
@fatemehp
Copy link
Contributor Author

fatemehp commented Oct 5, 2023

@wgtmac , @mapleFU are we ready to merge this?

Copy link
Member

@mapleFU mapleFU left a comment

Choose a reason for hiding this comment

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

Personally LGTM. We're at national holiday so might reply later.

Also cc @pitrou for review

cpp/src/parquet/reader_test.cc Outdated Show resolved Hide resolved
cpp/src/parquet/file_reader.h Outdated Show resolved Hide resolved
@fatemehp
Copy link
Contributor Author

fatemehp commented Oct 9, 2023

@wgtmac I tried to address the comments.

Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

The CI failures should be unrelated. I have retriggered failed ones.

cc @pitrou @emkornfield

@fatemehp
Copy link
Contributor Author

The error seems unrelated. @wgtmac, @mapleFU could you merge this?

@wgtmac
Copy link
Member

wgtmac commented Oct 12, 2023

The error seems unrelated. @wgtmac, @mapleFU could you merge this?

Let's wait a while for opinions from @pitrou @emkornfield

@pitrou
Copy link
Member

pitrou commented Oct 12, 2023

@wgtmac I'll let you handle this if you don't mind.

@wgtmac
Copy link
Member

wgtmac commented Oct 13, 2023

No problem! @pitrou

@emkornfield
Copy link
Contributor

I think if we are going to be exposing this publicly we should remove the internal namespace from it. This can likely be done as a follow-up. Otherwise seems good to me.

@wgtmac
Copy link
Member

wgtmac commented Oct 17, 2023

I think if we are going to be exposing this publicly we should remove the internal namespace from it. This can likely be done as a follow-up. Otherwise seems good to me.

Thanks @emkornfield! Then I will merge it as is.

Please remove the internal namespace in a follow-up change if you have time. Thanks! @fatemehp

@wgtmac wgtmac merged commit d3a576d into apache:main Oct 17, 2023
33 of 34 checks passed
@wgtmac wgtmac removed the awaiting committer review Awaiting committer review label Oct 17, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit d3a576d.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
…oupReader (apache#37003)

Currently we only can get a ColumnReader for a column from RowGroupReader. We need an API to return a RecordReader for the column.

Moved ComputeLevelInfo from column_writer to level_conversion so that it can be shared between column_writer and file_reader.
* Closes: apache#37002

Lead-authored-by: Fatemah Panahi <[email protected]>
Co-authored-by: Fatemah Panahi <[email protected]>
Signed-off-by: Gang Wu <[email protected]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…oupReader (apache#37003)

Currently we only can get a ColumnReader for a column from RowGroupReader. We need an API to return a RecordReader for the column.

Moved ComputeLevelInfo from column_writer to level_conversion so that it can be shared between column_writer and file_reader.
* Closes: apache#37002

Lead-authored-by: Fatemah Panahi <[email protected]>
Co-authored-by: Fatemah Panahi <[email protected]>
Signed-off-by: Gang Wu <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…oupReader (apache#37003)

Currently we only can get a ColumnReader for a column from RowGroupReader. We need an API to return a RecordReader for the column.

Moved ComputeLevelInfo from column_writer to level_conversion so that it can be shared between column_writer and file_reader.
* Closes: apache#37002

Lead-authored-by: Fatemah Panahi <[email protected]>
Co-authored-by: Fatemah Panahi <[email protected]>
Signed-off-by: Gang Wu <[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.

[C++][Parquet] Add api to get RecordReader from RowGroupReader.
5 participants