Skip to content

Conversation

@crystalxyz
Copy link
Contributor

@crystalxyz crystalxyz commented Oct 23, 2025

Which issue does this PR close?

Rationale for this change

The first step to fully support dynamic filter pushdown is to allow dynamic filter creation when the build side is on the right. This feature enables right side as the build side, and also implements bound collection from the right.

The concept "build side" here means that either this side is preserved, or its bound can be safely pushed down to the other side without impacting the result. The other side is called "probe side".

What changes are included in this PR?

  • A function that determines which side is the build side for all the JoinTypes.
  • Support the creation of dynamic filter for more JoinTypes.
  • Add support for the joins that have right build side to collect stream correctly.
  • Bound collection for right build side (via stream).

Note: In hash join, we collect the left side at first and get its bound naturally. For right build side, it needs to go through a different path by calculating bounds in fetch_next_probe, which is not the best practice.

TODO: Still looking for ways to make right side bound collection more natural.

Are these changes tested?

Unit test added to test both left join and right join. Bounds are collected correctly.

TODO: verify if any query plan is impacted.

Are there any user-facing changes?

No user-facing changes because the physical plan implementation should be internal.

No breaking change to public APIs.

@github-actions github-actions bot added the physical-plan Changes to the physical-plan crate label Oct 23, 2025
@jonathanc-n
Copy link
Contributor

cc @adriangb

@jonathanc-n
Copy link
Contributor

I may be wrong here, but I believe hash join exec creates any dynamic filters any swapping, so the right side will always be the probe side.

@crystalxyz
Copy link
Contributor Author

I may be wrong here, but I believe hash join exec creates any dynamic filters any swapping, so the right side will always be the probe side.

@jonathanc-n Yeah thanks for pointing that out. I found that I didn't update the probe_side() function. I will try to refactor it, although the assumption (that the right side is always the probe side) is deeply embedded in the code.

@crystalxyz crystalxyz changed the title feat: Allow dynamic filter pushdown to handle both left and right sides to be the probe side feat: Enable creating dynamic filters for both sides; support right side bound collection Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants