Skip to content

[EXP][C++] Deduplicate schemas when scanning Dataset - #45340

Closed
pitrou wants to merge 1 commit into
apache:mainfrom
pitrou:exp_deduplicate_schema
Closed

pitrou wants to merge 1 commit into
apache:mainfrom
pitrou:exp_deduplicate_schema

Conversation

@pitrou

@pitrou pitrou commented Jan 23, 2025

Copy link
Copy Markdown
Member

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@pitrou

pitrou commented Jan 23, 2025

Copy link
Copy Markdown
Member Author

@ursabot please benchmark

@ursabot

ursabot commented Jan 23, 2025

Copy link
Copy Markdown

Benchmark runs are scheduled for commit f6810357ba1ebe3dbfbe93acbeaaec1496d09d7c. Watch https://buildkite.com/apache-arrow and https://conbench.ursa.dev for updates. A comment will be posted here when the runs are complete.

@pitrou

pitrou commented Jan 23, 2025

Copy link
Copy Markdown
Member Author

@ursabot please benchmark

@ursabot

ursabot commented Jan 23, 2025

Copy link
Copy Markdown

Benchmark runs are scheduled for commit a0503f33ca75c42a0d2264f1f76537a46daea65a. Watch https://buildkite.com/apache-arrow and https://conbench.ursa.dev for updates. A comment will be posted here when the runs are complete.

@pitrou

pitrou commented Jan 23, 2025

Copy link
Copy Markdown
Member Author

@icexelloss This is a quick experiment that you might want to try out on a real-world use case. I don't seem to get any tangible benefits on a synthetic dataset, though it might be due to memory fragmentation.

@conbench-apache-arrow

Copy link
Copy Markdown

Thanks for your patience. Conbench analyzed the 0 benchmarking runs that have been run so far on PR commit f6810357ba1ebe3dbfbe93acbeaaec1496d09d7c.

None of the specified runs were found on the Conbench server.

The full Conbench report has more details.

@conbench-apache-arrow

Copy link
Copy Markdown

Thanks for your patience. Conbench analyzed the 4 benchmarking runs that have been run so far on PR commit a0503f33ca75c42a0d2264f1f76537a46daea65a.

There were 775 benchmark results indicating a performance regression:

The full Conbench report has more details.

@pitrou

pitrou commented Jan 24, 2025

Copy link
Copy Markdown
Member Author

Ok, there are so many unrelated "regressions" in the report above that I'm going to launch another benchmarking run, as it's likely that external factors have influenced that run.

@pitrou

pitrou commented Jan 24, 2025

Copy link
Copy Markdown
Member Author

@ursabot please benchmark

@ursabot

ursabot commented Jan 24, 2025

Copy link
Copy Markdown

Commit a0503f33ca75c42a0d2264f1f76537a46daea65a already has scheduled benchmark runs.

@pitrou
pitrou force-pushed the exp_deduplicate_schema branch from a0503f3 to 335a46b Compare January 24, 2025 13:49
@pitrou

pitrou commented Jan 24, 2025

Copy link
Copy Markdown
Member Author

@ursabot please benchmark

@ursabot

ursabot commented Jan 24, 2025

Copy link
Copy Markdown

Benchmark runs are scheduled for commit 335a46bac4b5f4828656b2a3c48181896e567634. Watch https://buildkite.com/apache-arrow and https://conbench.ursa.dev for updates. A comment will be posted here when the runs are complete.

@conbench-apache-arrow

Copy link
Copy Markdown

Thanks for your patience. Conbench analyzed the 4 benchmarking runs that have been run so far on PR commit 335a46bac4b5f4828656b2a3c48181896e567634.

There were 23 benchmark results indicating a performance regression:

The full Conbench report has more details.

@pitrou
pitrou force-pushed the exp_deduplicate_schema branch from 335a46b to 11b7ad8 Compare January 27, 2025 14:39
@icexelloss

Copy link
Copy Markdown
Contributor

@pitrou Thanks! cc @timothydijamco

@timothydijamco

timothydijamco commented Feb 5, 2025 •

Copy link
Copy Markdown

Thanks for this PR, seems like a good idea to try out.

In response to #45287 (comment): I didn't observe any difference between a version of Arrow with the metadata-clearing patch (#45330) vs a version of Arrow with the metadata-clearing patch plus this patch here in this PR.

Synthetic data

500 files, each with 1 row and 10,000 columns with 200-character-long column names

Peak memory

Performing a "scan" or loading the table into memory

Only metadata-clearing (#45330) With metadata-clearing (#45330) and schema deduplication (#45340)
One "scan" (pull batches from scanner->RecordBatchReader() until exhausted) 1.49GB 1.48GB
One scanner->ToTable() 1.57GB 1.55GB

Memory profiles

Performing two "scans"

Only metadata-clearing (#45330) With metadata-clearing (#45330) and schema deduplication (#45340)
Screen Shot 2025-02-05 at 5 17 31 PM Screen Shot 2025-02-05 at 5 17 48 PM

Real data

I ran on a variety of real datasets we have internally (data size varies from <1GB of data to 40GB of data, num columns varies from hundreds to thousands, number of files varies from 1 to hundreds) in the "scan" use case and "load table" use case and did not observe any memory usage difference between the two Arrow versions as well

@github-actions

Copy link
Copy Markdown

Thank you for your contribution. Unfortunately, this pull request has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this PR will be closed in 14 days. Feel free to re-open this if it has been closed in error. If you do not have repository permissions to reopen the PR, please tag a maintainer.

@github-actions github-actions Bot added the Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise label Feb 24, 2026
@github-actions github-actions Bot closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: C++ Component: Parquet Status: stale-warning Issues and PRs flagged as stale which are due to be closed if no indication otherwise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants