osipovartem commented on code in PR #26145:
URL: https://github.com/apache/datafusion/pull/26145#discussion_r4428737285


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -125,6 +128,215 @@ fn scalar_argument_for_field(expr: &Expr, arg_field: 
&FieldRef) -> Option<Scalar
     }
 }
 
+// Resolve metadata bottom-up for branches whose metadata can be preserved.

Review Comment:
   The bottom-up path avoids re-running type/nullability inference for every 
suffix of a nested CASE chain. I kept it for CASE, forwarding wrappers and 
binary expressions; other branches use native `to_field` without the depth 
cutoff. Added counted regressions and nested benchmarks; CASE/UDF re-inference 
remains a separate limitation.



##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -1263,6 +1545,601 @@ mod tests {
         assert_eq!(meta, outer_ref.metadata(&schema).unwrap());
     }
 
+    #[test]

Review Comment:
   Consolidated the SQL cases in `metadata.slt` in #26158, including #26895. 
The remaining Rust tests cover API-only annotations, pre-coercion type guards, 
custom `ExprSchema` behavior and inference-count regressions.



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