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 dynamic filters pushdown from multiple operators on same column #10478

Closed
wants to merge 1 commit into from

Conversation

Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Jul 16, 2024

Summary:
The data structure we used in table scan operator to keep dynamic
filters can only hold one filter per column. When multiple operators pushing
dynamic filters to the same column, the later ones would overwrite the previous
filters on the same column. Fix this by merging the existing filter with the
new filter.

Differential Revision: D59814502

@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 Jul 16, 2024
@facebook-github-bot
Copy link
Contributor

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

Copy link

netlify bot commented Jul 16, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 1c06780
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6696c572189dd40008e5964f

@facebook-github-bot
Copy link
Contributor

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

Yuhta added a commit to Yuhta/velox that referenced this pull request Jul 16, 2024
…acebookincubator#10478)

Summary:
Pull Request resolved: facebookincubator#10478

The data structure we used in table scan operator to keep dynamic
filters can only hold one filter per column.  When multiple operators pushing
dynamic filters to the same column, the later ones would overwrite the previous
filters on the same column.  Fix this by merging the existing filter with the
new filter.

Differential Revision: D59814502
@amitkdutta
Copy link
Contributor

I understand it's hard to detect such bugs. But wondering if there is any fuzzer improvement done for such cases so that we can gain more confidence on the code.
CC: @kagamiori @kgpai

@Yuhta Yuhta changed the title Fix dynamic filter pushdown Fix dynamic filters pushdown from multiple operators on same column Jul 16, 2024
@facebook-github-bot
Copy link
Contributor

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

Yuhta added a commit to Yuhta/velox that referenced this pull request Jul 16, 2024
…acebookincubator#10478)

Summary:
Pull Request resolved: facebookincubator#10478

The data structure we used in table scan operator to keep dynamic
filters can only hold one filter per column.  When multiple operators pushing
dynamic filters to the same column, the later ones would overwrite the previous
filters on the same column.  Fix this by merging the existing filter with the
new filter.

Differential Revision: D59814502
Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

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

@Yuhta Jimmy, thank you for the fix. Would you double check that the test fails without the changes before landing?

…acebookincubator#10478)

Summary:
Pull Request resolved: facebookincubator#10478

The data structure we used in table scan operator to keep dynamic
filters can only hold one filter per column.  When multiple operators pushing
dynamic filters to the same column, the later ones would overwrite the previous
filters on the same column.  Fix this by merging the existing filter with the
new filter.

Reviewed By: mbasmanova

Differential Revision: D59814502
@Yuhta
Copy link
Contributor Author

Yuhta commented Jul 16, 2024

@mbasmanova Sure I checked it failed before pushing this version

@facebook-github-bot
Copy link
Contributor

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

@Yuhta
Copy link
Contributor Author

Yuhta commented Jul 16, 2024

@amitkdutta A new full plan fuzzer would be needed for such cases. And we need to fuzz the query plan, in addition to data, and check against some invariance (for example with and without dynamic filter enabled). We need to add more invariances in order to catch more bugs though, but they are hard to find.

Another way is to have a full SQL fuzzer and compare the result of Prestissimo with Presto Java. The tricky part is to generate proper SQL and data not always error out or hanging there forever.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2e3bf33.

Copy link

Conbench analyzed the 1 benchmark run on commit 2e3bf338.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

@amitkdutta
Copy link
Contributor

@amitkdutta A new full plan fuzzer would be needed for such cases. And we need to fuzz the query plan, in addition to data, and check against some invariance (for example with and without dynamic filter enabled). We need to add more invariances in order to catch more bugs though, but they are hard to find.

Another way is to have a full SQL fuzzer and compare the result of Prestissimo with Presto Java. The tricky part is to generate proper SQL and data not always error out or hanging there forever.

@Yuhta Thanks for the reply. What you are describing (a full SQL fuzzer) is actually a verification system (e.g. Presto Verifier). Basically, a system that takes a set of SQL (either from random sampled or other way), test with a gold version (could be Prestissimo with production velox or Presto java) with new version. The comparsion of end to end SQL is much more useful and direct indicator of correctness. If you want to get a fuzzer like behavior, generating random SQL and feed it through the framework will achieve that.

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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants