Skip to content

[GLUTEN-11888] [VL] Parallel build hash table to improve bhj performance#11889

Merged
JkSelf merged 4 commits intoapache:mainfrom
JkSelf:bhj-build-optimization
Apr 9, 2026
Merged

[GLUTEN-11888] [VL] Parallel build hash table to improve bhj performance#11889
JkSelf merged 4 commits intoapache:mainfrom
JkSelf:bhj-build-optimization

Conversation

@JkSelf
Copy link
Copy Markdown
Contributor

@JkSelf JkSelf commented Apr 8, 2026

What changes are proposed in this pull request?

  1. Add buildThreads and build hash table time metrics.
  2. Introduce spark.gluten.velox.broadcast.build.targetBytesPerThreaconfiguration to dynamically calculate hash table thread counts based on raw data size.

The existing implementation uses a single thread to build the hash table. When the hash table threshold is set to a large value (e.g., 800MB), the build time becomes a bottleneck. Our benchmarks on TPC-DS Q69 (10TB) show that building an 800MB hash table with a single thread takes 37s. By enabling parallel builds with this PR, the execution time drops to 25s.

How was this patch tested?

Existing tests

Was this patch authored or co-authored using generative AI tooling?

No

Related issue: #11888

@github-actions github-actions bot added CORE works for Gluten Core VELOX labels Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Run Gluten Clickhouse CI on x86

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Run Gluten Clickhouse CI on x86

Copy link
Copy Markdown
Contributor

@jinchengchenghh jinchengchenghh left a comment

Choose a reason for hiding this comment

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

Overall looks good, only a small nits, could you also describe the performance and the limitation in PR description?

@JkSelf
Copy link
Copy Markdown
Contributor Author

JkSelf commented Apr 8, 2026

@jinchengchenghh Already updated the performance data in PR description. Please help to review again. Thanks.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Run Gluten Clickhouse CI on x86

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Run Gluten Clickhouse CI on x86

@JkSelf JkSelf merged commit 89a77b6 into apache:main Apr 9, 2026
61 checks passed
malinjawi pushed a commit to malinjawi/incubator-gluten that referenced this pull request Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLICKHOUSE CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants