vegarsti commented on code in PR #16985:
URL: https://github.com/apache/datafusion/pull/16985#discussion_r2244856353


##########
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:
   Oh I remember now: I tried cloning but this doesn't work as this doesn't 
have the correct `Schema` (the `UnnestExec` necessarily has a different schema 
than the input plan). Doing so fails other test cases:
   
   ```
   1. query failed: DataFusion error: Internal error: Input field name 
__unnest_placeholder(range(Int64(0),Int64(10))) does not match with the 
projection expression __unnest_placeholder(range(Int64(0),Int64(10)),depth=1).
   This issue was likely caused by a bug in DataFusion's code. Please help us 
to resolve this by filing a bug report in our issue tracker: 
https://github.com/apache/datafusion/issues
   [SQL] select * from (
   with t as (
       select id, id % 5 id1 from (select unnest(range(0,10)) id)
   ), t1 as (
       select id % 10 id, id + 2 id1 from (select unnest(range(0,10)) id)
   )
   select * from t right join t1 on t.id1 = t1.id and t.id > t1.id1
   ) order by 1, 2, 3, 4
   at 
/Users/vegard/dev/datafusion/datafusion/sqllogictest/test_files/sort_merge_join.slt:603
   ```



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to