kosiew commented on code in PR #16771:
URL: https://github.com/apache/datafusion/pull/16771#discussion_r2209435726


##########
datafusion/expr/src/utils.rs:
##########
@@ -992,7 +996,7 @@ pub fn iter_conjunction_owned(expr: Expr) -> impl 
Iterator<Item = Expr> {
                     stack.push(*right);
                     stack.push(*left);
                 }
-                Expr::Alias(Alias { expr, .. }) => stack.push(*expr),
+                Expr::Alias(alias_box) => stack.push(*alias_box.expr),

Review Comment:
   boxed_alias



##########
datafusion/expr/src/expr_rewriter/mod.rs:
##########
@@ -250,7 +257,9 @@ fn coerce_exprs_for_schema(
             let new_type = dst_schema.field(idx).data_type();
             if new_type != &expr.get_type(src_schema)? {
                 match expr {
-                    Expr::Alias(Alias { expr, name, .. }) => {
+                    Expr::Alias(alias_box) => {
+                        // alias_box: Box<Alias>
+                        let Alias { expr, name, .. } = *alias_box;

Review Comment:
   nit - use boxed_alias instead, for consistency



##########
datafusion/expr/src/expr_rewriter/order_by.rs:
##########
@@ -137,8 +137,11 @@ fn rewrite_in_terms_of_projection(
 /// so avg(c) as average will match avgc
 fn expr_match(needle: &Expr, expr: &Expr) -> bool {
     // check inside aliases
-    if let Expr::Alias(Alias { expr, .. }) = &expr {
-        expr.as_ref() == needle
+    if let Expr::Alias(alias_box) = expr {
+        // alias_box: &Box<Alias>, so alias_box.as_ref() is &Alias
+        let alias: &Alias = alias_box.as_ref();

Review Comment:
   same as above - boxed_alias



##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -242,9 +246,11 @@ impl ExprSchemable for Expr {
     /// column that does not exist in the schema.
     fn nullable(&self, input_schema: &dyn ExprSchema) -> Result<bool> {
         match self {
-            Expr::Alias(Alias { expr, .. }) | Expr::Not(expr) | 
Expr::Negative(expr) => {
+            Expr::Alias(alias_box) => {
+                let Alias { expr, .. } = alias_box.as_ref();

Review Comment:
   boxed_alias



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