alamb commented on code in PR #20051:
URL: https://github.com/apache/datafusion/pull/20051#discussion_r2756460102


##########
datafusion/optimizer/src/simplify_expressions/udf_preimage.rs:
##########
@@ -312,6 +321,30 @@ mod test {
         assert_eq!(optimize_test(expr, &schema), expected);
     }
 
+    #[test]
+    fn test_preimage_in_list_rewrite() {
+        let schema = test_schema();
+        let expr = preimage_udf_expr().in_list(vec![lit(500), lit(600)], 
false);
+        let expected = or(
+            and(col("x").gt_eq(lit(100)), col("x").lt(lit(200))),
+            and(col("x").gt_eq(lit(300)), col("x").lt(lit(400))),
+        );
+
+        assert_eq!(optimize_test(expr, &schema), expected);
+    }
+
+    #[test]

Review Comment:
   can you please also add a negative test for a "large" number of IN list 
items (like 100)?



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