pushdown_sorts
pushes a SortExec through a node in violation of its stated input ordering requirements
#11675
Labels
bug
Something isn't working
Describe the bug
The
SanityChecker
added in #11196 from @mustafasrepo is triggering on some of our plans. I believe the SanityChecker is correctly rejecting a plan that doesn't satisfy the sort order requirements (aka it found a real bug)Specifically we have a plan like this
But the PushdownSorts optimizer pushes the sort through the ExtensionNode, which violates the stated required input order:
Here is what the actual plan looks like.
This is the output of the enforce sorting pass. Note this is not the whole plan, this fragment actually feeds into a WindowExec node
However, sort_pushdown pushes the sort below the
GapFillExec
incorrectlybecause the pushed through sort doesn't satisfy the required input order.
To Reproduce
I am still working on a DataFusion only reproducer.
Expected behavior
The expected behavior is that sorts are not pushed down when doing so would violate the
required_input_ordering
Additional context
We found another issue #11492
I found if I changed gapfill to return 'false' for maintains input order the query passes
However the node actually does preserve the input order so this is just a workaround
The text was updated successfully, but these errors were encountered: