mustafasrepo commented on code in PR #9690:
URL: https://github.com/apache/arrow-datafusion/pull/9690#discussion_r1537091749


##########
datafusion/optimizer/src/optimize_projections.rs:
##########
@@ -162,14 +163,37 @@ fn optimize_projections(
                 .map(|input| 
((0..input.schema().fields().len()).collect_vec(), false))
                 .collect::<Vec<_>>()
         }
+        LogicalPlan::Extension(extension) => {
+            let children = extension.node.inputs();
+            if children.len() != 1 {
+                // TODO: Add support for `LogicalPlan::Extension` with multi 
children.
+                return Ok(None);
+            }
+            // has single child
+            let exprs = plan.expressions();
+            let child = children[0];
+            let node_schema = extension.node.schema();
+            let child_schema = child.schema();
+            if let Some(parent_required_indices_mapped) =

Review Comment:
   This is much better. Knowing the mapping of the `Column`s is adequate. Using 
`Expr` has no additional support. Thanks @alamb for this suggestion. I will 
update this PR to use this mechanism. Then we can discuss further. I will let 
you know when it ready for further review.



-- 
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]

Reply via email to