Skip to content

[VL] Diable spark join keys rewrite#11643

Closed
JkSelf wants to merge 3 commits into
apache:mainfrom
JkSelf:disableJoinKeyRewrite
Closed

[VL] Diable spark join keys rewrite#11643
JkSelf wants to merge 3 commits into
apache:mainfrom
JkSelf:disableJoinKeyRewrite

Conversation

@JkSelf

@JkSelf JkSelf commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

When offloading Hash Join to Velox, Gluten currently cannot fully leverage the performance benefits of the Hash Join Key Rewriting feature. In fact, enabling this feature can lead to performance degradation.

During our optimization of BHJ—aimed at building the hash table only once per executor—we discovered that Dynamic Filter Push-down DFP is enabled when Key Rewriting is enabled. This occurs because the rewriting process introduces CAST(int AS long) expressions to both the Build and Probe sides within the Project operator. Since Velox only supports filter push-down on columns without complex expressions, these added casts block the optimization, resulting in a performance degradation.

To address this, we have disabled the Key Rewriting feature specifically within the HashJoin#canRewriteAsLongType method.

How was this patch tested?

Existing unit tests

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

No

@github-actions github-actions Bot added CORE works for Gluten Core VELOX TOOLS labels Feb 23, 2026
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@JkSelf
JkSelf force-pushed the disableJoinKeyRewrite branch from bbe1180 to 27ff7a0 Compare February 24, 2026 21:08
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions github-actions Bot added the DOCS label Feb 24, 2026
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@JkSelf
JkSelf force-pushed the disableJoinKeyRewrite branch from ddf6973 to c627aeb Compare February 25, 2026 09:52
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86


override def enableJoinKeysRewrite(): Boolean = false
override def enableJoinKeysRewrite(): Boolean = {
GlutenConfig.get.hashJoinKeysRewrite

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like the previous value is false?

trait HashJoin extends JoinCodegenSupport {
def buildSide: BuildSide

override def simpleStringWithNodeId(): String = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do you need to copy the file?

@JkSelf JkSelf closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core DOCS TOOLS VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants