CTTY commented on code in PR #2142:
URL: https://github.com/apache/iceberg-rust/pull/2142#discussion_r2830688660


##########
crates/integrations/datafusion/src/physical_plan/expr_to_predicate.rs:
##########
@@ -681,4 +707,35 @@ mod tests {
             Reference::new("bar").starts_with(Datum::string("测试"))
         );
     }
+
+    #[test]
+    fn test_predicate_conversion_with_isnan() {
+        let predicate = convert_to_iceberg_predicate("isnan(qux)").unwrap();
+        assert_eq!(predicate, Reference::new("qux").is_nan());
+    }
+
+    #[test]
+    fn test_predicate_conversion_with_not_isnan() {
+        let predicate = convert_to_iceberg_predicate("NOT 
isnan(qux)").unwrap();
+        assert_eq!(predicate, !Reference::new("qux").is_nan());
+    }
+
+    #[test]
+    fn test_predicate_conversion_with_isnan_and_other_condition() {
+        let sql = "isnan(qux) AND foo > 1";
+        let predicate = convert_to_iceberg_predicate(sql).unwrap();
+        let expected_predicate = Predicate::and(
+            Reference::new("qux").is_nan(),
+            Reference::new("foo").greater_than(Datum::long(1)),
+        );
+        assert_eq!(predicate, expected_predicate);
+    }
+
+    #[test]
+    fn test_predicate_conversion_with_isnan_unsupported_arg() {

Review Comment:
   Could you create another issue to track complex numeric expression and left 
some TODO comments? An unary expression for isnan feels too limited to be useful



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