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

fix: Remove support for evaluating sub-optimial filters in joins #12251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bikramSingh91
Copy link
Contributor

Summary:
This enables the hash join operator to throw an error when a filter is applied exclusively
to columns from one side of the join. This validation ensures the detection of
suboptimal plans, where filters are evaluated at the join operator instead of being
pushed to the upstream scan node of the respective join side for optimization.

Also adds a private API to ensure an internal state variable which is a buffer is
unique before any mutations are applied to it.

Differential Revision: D69085909

Summary:
This enables the hash join operator to throw an error when a filter is applied exclusively
to columns from one side of the join. This validation ensures the detection of
suboptimal plans, where filters are evaluated at the join operator instead of being
pushed to the upstream scan node of the respective join side for optimization.

Also adds a private API to ensure an internal state variable which is a buffer is
unique before any mutations are applied to it.

Differential Revision: D69085909
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 4, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69085909

Copy link

netlify bot commented Feb 4, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit e5bc251
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67a15dace6ceff000881dbaa

// Note: Use this method close to the block that modifies the buffer to ensure
// mutability does not change in-between.
vector_size_t* getRawMutableOuputRowMapping() {
VELOX_CHECK(outputRowMapping_->isMutable());
Copy link
Contributor

@Yuhta Yuhta Feb 4, 2025

Choose a reason for hiding this comment

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

This is check is failing because we keep 2 references: One in outputRowMapping_ and another in filter input. Maybe loose the condition a little bit? The case that would cause problem would have 3 references: outputRowMapping_, filter input, filter output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants