Jefffrey commented on code in PR #20281:
URL: https://github.com/apache/datafusion/pull/20281#discussion_r2796488985


##########
datafusion/expr/src/expr_rewriter/order_by.rs:
##########
@@ -235,18 +235,22 @@ mod test {
             TestCase {
                 desc: r#"min(c2) --> "min(c2)" -- (column *named* 
"min(t.c2)"!)"#,
                 input: sort(min(col("c2"))),
-                expected: sort(col("min(t.c2)")),
+                expected: 
sort(Expr::Column(Column::new_unqualified("min(t.c2)"))),

Review Comment:
   Why is this being changed?



##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -5172,8 +5172,11 @@ impl fmt::Debug for ScalarValue {
             ScalarValue::List(_) => write!(f, "List({self})"),
             ScalarValue::LargeList(_) => write!(f, "LargeList({self})"),
             ScalarValue::Struct(struct_arr) => {
-                // ScalarValue Struct should always have a single element
-                assert_eq!(struct_arr.len(), 1);
+                // ScalarValue Struct may have 0 rows (e.g. empty array not 
foldable) or 1 row
+                if struct_arr.is_empty() {
+                    return write!(f, "Struct({{}})");
+                }

Review Comment:
   This doesn't seem correct; a scalar should always have length 1? Also this 
fix seems unrelated to the issue at hand



##########
datafusion/optimizer/src/simplify_expressions/expr_simplifier.rs:
##########
@@ -2869,125 +2872,132 @@ mod tests {
 
     #[test]
     fn test_simplify_composed_bitwise_and() {
-        // ((c2 > 5) & (c1 < 6)) & (c2 > 5) --> (c2 > 5) & (c1 < 6)
+        // ((c3 & 1) & (c3 & 2)) & (c3 & 1) --> simplified (duplicate folded)

Review Comment:
   Why are these tests being changed?



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