vegarsti commented on code in PR #16985:
URL: https://github.com/apache/datafusion/pull/16985#discussion_r2243466485
##########
datafusion/physical-plan/src/unnest.rs:
##########
@@ -101,8 +101,22 @@ impl UnnestExec {
input: &Arc<dyn ExecutionPlan>,
schema: SchemaRef,
) -> PlanProperties {
+ // Extract equivalence properties from input plan
+ let input_eq_properties = input.equivalence_properties();
+ let input_oeq_class = input_eq_properties.oeq_class();
+ let orderings = input_oeq_class.orderings().to_vec();
+ let eq_group = input_eq_properties.eq_group();
+ let constraints = input_eq_properties.constraints();
+
Review Comment:
In the UnnestExec, we have `list_column_indices: Vec<ListUnnest>` and
`struct_column_indices: Vec<usize>`. What I don't know is whether we need to
explicitly remove these from the new `EquivalenceProperties` object, or
whether that happens "automatically".
##########
datafusion/physical-plan/src/unnest.rs:
##########
@@ -101,8 +101,22 @@ impl UnnestExec {
input: &Arc<dyn ExecutionPlan>,
schema: SchemaRef,
) -> PlanProperties {
+ // Extract equivalence properties from input plan
+ let input_eq_properties = input.equivalence_properties();
+ let input_oeq_class = input_eq_properties.oeq_class();
+ let orderings = input_oeq_class.orderings().to_vec();
+ let eq_group = input_eq_properties.eq_group();
+ let constraints = input_eq_properties.constraints();
+
+ // Create new equivalence properties for the unnest plan based on the
input plan
+ let mut eq_properties = EquivalenceProperties::new(schema);
+ eq_properties.add_orderings(orderings);
+ eq_properties
+ .add_equivalence_group(eq_group.to_owned())
+ .unwrap(); // We can unwrap this because we know this is a valid
equivalence group
Review Comment:
Does this make sense?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]