-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Overlapping ExecutionPlan::maintains_input_order(), equivalence_properties and maintains_input_order
are confusing
#8120
Comments
ExecutionPlan::maintains_input_order(), ExecutionPlan::equivalence_properties and ExecutionPlan::maintains_input_order
ExecutionPlan::maintains_input_order(), equivalence_properties and maintains_input_order
are confusing
@alamb I agree with you we could simplify the API, to prevent inconsistent usage. However, I think keeping self.equivalence_properties.output_ordering() This way, when some one loses |
I don't understand how this would work for something like |
We have a method |
Here is a PR that tries to document the current state a bit better: #8128 |
Is your feature request related to a problem or challenge?
While upgrading IOx, to use #8006, I found that the
EnforceSorting
pass was adding a sort node to anExecutionPlan
, even when the input to that plan was sorted correctly andExecutionPlan::maintains_input_order
returns true, where prior to #8006 it did not.The issue is that our node did not also correctly report its
EquivalenceProperties
which now the EnforceSorting pass relies on.Thus, I think we are in the situation where
output_ordering
, andequivalence_properties
is used by EnforceSortingmaintains_input_order
is used in other placesThis leads to the situation where implementers of ExecutionPlan have to keep the three methods in sync, which I think this is confusing and error prone.
Describe the solution you'd like
I propose we deprecate
maintains_input_order
(with a hint about equivalence classes to help other users) and use onlyoutput_ordering
andequivalence_properties
to determine if the order is maintainedDescribe alternatives you've considered
No response
Additional context
Example
For a plan like this
Prior to #8006
No sort is added,
After #8006
The EnforceSorting rule adds a
SortExec
at the topAdding
equivalence_properties
fixed the problem:The text was updated successfully, but these errors were encountered: