Skip to content

chore: native_datafusion use try_pushdown_filters#4299

Merged
mbutrovich merged 3 commits into
apache:mainfrom
mbutrovich:try_pushdown_filters
May 13, 2026
Merged

chore: native_datafusion use try_pushdown_filters#4299
mbutrovich merged 3 commits into
apache:mainfrom
mbutrovich:try_pushdown_filters

Conversation

@mbutrovich
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Discussion in apache/datafusion#22026 highlighted that Comet indiscriminately pushes filters into the scan without checking if they can be pushed down. This doesn't lead to incorrect behavior because we always have a FilterExec node above the scan anyway, so if any filters can't actually be pushed down then we get evaluation above. DataFusion wants to enforce a contract that try_pushdown_filters is called first, so let's adhere to that. Eventually we might introduce an optimization to elide the FilterExec if everything is successfully pushed down, but that's out of scope for this PR.

What changes are included in this PR?

Call try_pushdown_filters instead of building the CNF of filters in Comet and using with_predicate.

How are these changes tested?

Existing tests.

Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @mbutrovich

@mbutrovich mbutrovich marked this pull request as draft May 13, 2026 16:01
@mbutrovich
Copy link
Copy Markdown
Contributor Author

Marking as draft while I review some behavior based on discussion in today's DataFusion weekly call. I don't want this merged yet.

@mbutrovich mbutrovich marked this pull request as ready for review May 13, 2026 16:16
@mbutrovich
Copy link
Copy Markdown
Contributor Author

I updated the comments based on my research. This is okay to merge.

@andygrove andygrove added this to the 0.17.0 milestone May 13, 2026
@andygrove andygrove moved this from Todo to In progress in Comet Development May 13, 2026
@mbutrovich mbutrovich merged commit 3990ac3 into apache:main May 13, 2026
152 of 154 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Comet Development May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants