mustafasrepo commented on code in PR #9690: URL: https://github.com/apache/arrow-datafusion/pull/9690#discussion_r1537500656
########## 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: @alamb I introduced new API `fn necessary_children_exprs(&self, output_columns: &[usize]) -> Option<Vec<Vec<usize>>>` to this PR (where return type is changed to return result per child). I also added a new test case showing the support for user defined nodes with multiple children. This Pr is 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org