Skip to content

Conversation

@mihailoale-db
Copy link
Contributor

What changes were proposed in this pull request?

In this PR I propose to make ResolvedCollation evaluable. By making ResolvedCollation evaluable, it can now pass the canEvaluateWithinJoin check, allowing the optimizer to use efficient hash joins for queries with inline COLLATE in join conditions (before this change we would fallback to BroadcastNestedLoopJoin).

Why are the changes needed?

To improve performance of specific queries (see added tests).

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added tests.

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

No.

@github-actions github-actions bot added the SQL label Oct 29, 2025
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM (Pending CIs).

@dongjoon-hyun
Copy link
Member

Merged to master. Thank you, @mihailoale-db and @cloud-fan .

huangxiaopingRD pushed a commit to huangxiaopingRD/spark that referenced this pull request Nov 25, 2025
### What changes were proposed in this pull request?
In this PR I propose to make `ResolvedCollation` evaluable. By making `ResolvedCollation` evaluable, it can now pass the `canEvaluateWithinJoin` check, allowing the optimizer to use efficient hash joins for queries with inline COLLATE in join conditions (before this change we would fallback to `BroadcastNestedLoopJoin`).

### Why are the changes needed?
To improve performance of specific queries (see added tests).

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Added tests.

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

Closes apache#52779 from mihailoale-db/makecollationresolvable.

Authored-by: mihailoale-db <mihailo.aleksic@databricks.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants