matthewgapp commented on code in PR #8840:
URL: https://github.com/apache/arrow-datafusion/pull/8840#discussion_r1451607784


##########
datafusion/core/src/physical_optimizer/projection_pushdown.rs:
##########
@@ -832,16 +834,22 @@ fn all_alias_free_columns(exprs: &[(Arc<dyn 
PhysicalExpr>, String)]) -> bool {
 fn new_projections_for_columns(
     projection: &ProjectionExec,
     source: &Option<Vec<usize>>,
-) -> Vec<usize> {
-    projection
-        .expr()
-        .iter()
-        .filter_map(|(expr, _)| {
-            expr.as_any()
-                .downcast_ref::<Column>()
-                .and_then(|expr| source.as_ref().map(|proj| 
proj[expr.index()]))
-        })
-        .collect()
+) -> Option<Vec<usize>> {
+    if source.is_none() {

Review Comment:
   Related to fixing panic which caused a unit test in cte.slt to fail. More 
info here 
https://github.com/apache/arrow-datafusion/pull/8840#discussion_r1449893839



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