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

Remove Eager Trait for Joins #10721

Merged
merged 3 commits into from
May 30, 2024

Conversation

berkaysynnada
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

EagerJoinStream trait is currently implemented only by SymmetricHashJoin. It was initially designed to be open-ended for other joins that could potentially work with an eager polling strategy. However, this strategy does not provide significant benefits or serve as a better alternative to other strategies. It is specifically suited to the nature of SymmetricHashJoin. Therefore, the implementation has been moved directly to SymmetricHashJoin.

Although it was suggested that SortMergeJoin might utilize this strategy, it does not require such a polling mechanism.

For simplification, this PR removes the redundant trait implementation and moves the existing implementation to where it is actually needed. If this trait is being utilized downstream, please share your thoughts.

What changes are included in this PR?

Removed EagerJoinStream and moved its implementation to SymmetricHashJoin.
Removed the handle_async_state macro, which does not simplify any complexity.

Are these changes tested?

Are there any user-facing changes?

There are no user-facing changes. This PR involves internal refactoring for simplification and does not impact public APIs.

@github-actions github-actions bot added the core Core DataFusion crate label May 30, 2024
Copy link
Contributor

@ozankabak ozankabak left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for this simplification.

Copy link
Contributor

@metegenez metegenez left a comment

Choose a reason for hiding this comment

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

LGTM as well.

@alamb
Copy link
Contributor

alamb commented May 30, 2024

cc @viirya and @comphead who I think are working on Sort Merge Join

@viirya
Copy link
Member

viirya commented May 30, 2024

Looks good to me. I don't see that SortMergeJoin is required to use this trait.

@@ -786,7 +786,7 @@ mod tests {
assert_eq!(
evaluate_partition_prefix(
partitions,
&[col("a").eq(lit("foo")).and((col("b").eq(lit("bar"))))],
&[col("a").eq(lit("foo")).and(col("b").eq(lit("bar")))],
Copy link
Contributor

Choose a reason for hiding this comment

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

this already fixed. twice :)

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm

@comphead comphead merged commit 7948183 into apache:main May 30, 2024
23 checks passed
findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* Remove eager trait

* Update helpers.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants