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-36773: [C++][Parquet] Avoid calculating prebuffer column bitmap multiple times #36774

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Jul 19, 2023

Rationale for this change

According to #36192 and #36649 . RowGroupReader using a bitmap to control a column-level prebuffer.

However, if all columns are selected, this will be a heavy overhead for building a bitmap multiple times.

What changes are included in this PR?

Build Prebuffer Bitmap once, and reuse that vector.

Are these changes tested?

no

Are there any user-facing changes?

no

@mapleFU mapleFU requested a review from wgtmac as a code owner July 19, 2023 16:37
@mapleFU
Copy link
Member Author

mapleFU commented Jul 19, 2023

@pitrou @wgtmac Would you mind take a look? I guess this might related to the regression

@github-actions
Copy link

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

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 19, 2023
@mapleFU mapleFU force-pushed the parquet/avoid-multiple-count-bitmap branch from 8a43f41 to c8e226b Compare July 19, 2023 16:45
@mapleFU
Copy link
Member Author

mapleFU commented Jul 19, 2023

Also cc @jp0317

@mapleFU mapleFU force-pushed the parquet/avoid-multiple-count-bitmap branch from c8e226b to a4208e4 Compare July 19, 2023 16:56
@mapleFU
Copy link
Member Author

mapleFU commented Jul 19, 2023

I wonder that if https://github.com/apache/arrow/pull/36774/files#r1268338192 is possible. Because I guess if no selection or projection, there are all-buffered. Should I do an optimization for all-buffered case, using a nullptr column bitmap?

@mapleFU
Copy link
Member Author

mapleFU commented Jul 20, 2023

@pitrou would mind take a look? This patch is small and simple

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

Thanks for noticing this @mapleFU .

@pitrou pitrou merged commit b31977f into apache:main Jul 24, 2023
37 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Jul 24, 2023
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Jul 24, 2023
@mapleFU mapleFU deleted the parquet/avoid-multiple-count-bitmap branch July 26, 2023 02:48
@conbench-apache-arrow
Copy link

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

R-JunmingChen pushed a commit to R-JunmingChen/arrow that referenced this pull request Aug 20, 2023
…map multiple times (apache#36774)

### Rationale for this change

According to apache#36192 and apache#36649 . RowGroupReader using a bitmap to control a column-level prebuffer.

However, if all columns are selected, this will be a heavy overhead for building a bitmap multiple times.

### What changes are included in this PR?

Build `Prebuffer` Bitmap once, and reuse that vector.

### Are these changes tested?

no

### Are there any user-facing changes?

no

* Closes: apache#36773

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…map multiple times (apache#36774)

### Rationale for this change

According to apache#36192 and apache#36649 . RowGroupReader using a bitmap to control a column-level prebuffer.

However, if all columns are selected, this will be a heavy overhead for building a bitmap multiple times.

### What changes are included in this PR?

Build `Prebuffer` Bitmap once, and reuse that vector.

### Are these changes tested?

no

### Are there any user-facing changes?

no

* Closes: apache#36773

Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
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] Prebuffer: Avoid calculating prebuffer column bitmap multiple times
3 participants