cetra3 commented on code in PR #24242:
URL: https://github.com/apache/datafusion/pull/24242#discussion_r3779891233


##########
datafusion/optimizer/src/extract_leaf_expressions.rs:
##########
@@ -833,6 +833,15 @@ fn split_and_push_projection(
     for (expr, (qualifier, field)) in 
proj.expr.iter().zip(original_schema.iter()) {
         if let Expr::Alias(alias) = expr
             && alias.name.starts_with(EXTRACTED_EXPR_PREFIX)
+            && let Expr::Column(inner_col) = alias.expr.as_ref()
+            && inner_col.name == alias.name
+        {
+            // passthrough alias: treat it as one that already exists in the 
input
+            extractors[0].columns_needed.insert(inner_col.clone());
+            recovery_exprs.push(expr.clone());
+            proj_exprs_captured += 1;
+        } else if let Expr::Alias(alias) = expr
+            && alias.name.starts_with(EXTRACTED_EXPR_PREFIX)

Review Comment:
   This is different in that it's the alias *inner* column that it's being 
matched on.  I guess we could combine the two match arms? But it might make it 
messier than this change



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

Reply via email to