Bug: applying multiple times EnforceDistribution
generates invalid plan
#14150
Labels
bug
Something isn't working
EnforceDistribution
generates invalid plan
#14150
Describe the bug
For a topk SQL:
select * from aggregate_test_100 ORDER BY c13 limit 5;
, If applied twiceEnforceDistribution
, will generate an invalid plan and result in the wrong result.The root reason is that the fetch of the limit will be missed at the second
EnforceDistribution
.To Reproduce
Here is an example to reproduce
Expected behavior
Generated a valid plan and correct result as the doc said: https://github.com/apache/datafusion/blob/main/datafusion/core/src/physical_optimizer/enforce_distribution.rs#L159-L168
Additional context
No response
The text was updated successfully, but these errors were encountered: