Skip to content

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

Merged
wgtmac merged 10 commits into
apache:mainfrom
fatemehp:master
Oct 17, 2023
Merged

wgtmac merged 10 commits into
apache:mainfrom
fatemehp:master

Conversation

@fatemehp

@fatemehp fatemehp commented Aug 3, 2023 •

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Aug 3, 2023

Copy link
Copy Markdown

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:

@mapleFU mapleFU left a comment

Copy link
Copy Markdown
Member

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?

Comment thread cpp/src/parquet/file_reader.h Resolved
Comment thread cpp/src/parquet/file_reader.h Outdated

// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread cpp/src/parquet/file_reader.cc Resolved
@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

github-actions Bot commented Aug 3, 2023

Copy link
Copy Markdown

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

Comment thread cpp/src/parquet/file_reader.h Resolved
Comment thread cpp/src/parquet/file_reader.h Resolved
Comment thread cpp/src/parquet/file_reader.h Outdated

// 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
Copy Markdown
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

mapleFU commented Aug 23, 2023

Copy link
Copy Markdown
Member

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

mapleFU commented Sep 12, 2023

Copy link
Copy Markdown
Member

ping @fatemehp , would we move forward?

@fatemehp

fatemehp commented Oct 3, 2023

Copy link
Copy Markdown
Contributor Author

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?

Comment thread cpp/src/parquet/file_reader.h Resolved
Comment thread cpp/src/parquet/reader_test.cc Resolved
@fatemehp

fatemehp commented Oct 5, 2023

Copy link
Copy Markdown
Contributor Author

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

@mapleFU mapleFU left a comment

Copy link
Copy Markdown
Member

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

Comment thread cpp/src/parquet/reader_test.cc Resolved
Comment thread cpp/src/parquet/file_reader.h Resolved
@fatemehp

fatemehp commented Oct 9, 2023

Copy link
Copy Markdown
Contributor Author

@wgtmac I tried to address the comments.

@wgtmac wgtmac left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

@wgtmac

wgtmac commented Oct 12, 2023

Copy link
Copy Markdown
Member

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

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

@pitrou

pitrou commented Oct 12, 2023 •

Copy link
Copy Markdown
Member

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

@wgtmac

wgtmac commented Oct 13, 2023

Copy link
Copy Markdown
Member

No problem! @pitrou

@emkornfield

Copy link
Copy Markdown
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

wgtmac commented Oct 17, 2023

Copy link
Copy Markdown
Member

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
@conbench-apache-arrow

Copy link
Copy Markdown

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.

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