jayzhan211 commented on code in PR #11564:
URL: https://github.com/apache/datafusion/pull/11564#discussion_r1685330429


##########
datafusion/physical-expr-common/src/utils.rs:
##########
@@ -134,6 +135,33 @@ pub fn limited_convert_logical_expr_to_physical_expr(
     }
 }
 
+pub fn limited_convert_logical_expr_to_physical_expr_with_dfschema(
+    expr: &Expr,
+    dfschema: &DFSchema,
+) -> Result<Arc<dyn PhysicalExpr>> {
+    match expr {
+        Expr::Alias(Alias { expr, .. }) => Ok(
+            limited_convert_logical_expr_to_physical_expr_with_dfschema(expr, 
dfschema)?,
+        ),
+        Expr::Column(col) => {
+            let idx = dfschema.index_of_column(col)?;

Review Comment:
   I found that I need dfschema in order to get the correct field, so I change 
all the UDAF to `create_aggregate_expr_with_dfschema` which is used internally 
for UDAF only. 



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