Skip to content

Filter pushdown past children with fetch limits causes correctness bug #21063

@shivbhatia10

Description

@shivbhatia10

Describe the bug

In the push_down_filter optimisation rule, we currently don't check if the child of a filter node has fetch limits. This is semantically equivalent to pushing a filter past a limit node, which is wrong. The same issue exists in the gather_filters_for_pushdown implementation for SortExec.

To Reproduce

I added unit tests in the fix PR which reproduce this behaviour.

Expected behavior

This should never happen, pushing a filter past for example a sort with a fetch limit causes incorrect behaviour.

Additional context

Fix here: #21057

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions