adriangb commented on code in PR #19129:
URL: https://github.com/apache/datafusion/pull/19129#discussion_r2599469986


##########
datafusion/pruning/src/pruning_predicate.rs:
##########
@@ -2774,6 +2811,66 @@ mod tests {
         Ok(())
     }
 
+    // Test that literal-to-literal comparisons are correctly evaluated.
+    // When both sides are constants, the expression should be evaluated 
directly
+    // and if it's false, all containers should be pruned.
+    #[test]
+    fn row_group_predicate_literal_false() {
+        // lit(1) = lit(2) is always false, so all containers should be pruned
+        let schema = Arc::new(Schema::new(vec![Field::new("c1", 
DataType::Int32, true)]));
+        let statistics = TestStatistics::new()
+            .with("c1", ContainerStats::new_i32(vec![Some(0)], 
vec![Some(10)]));
+        let expected_ret = &[false];
+        prune_with_expr(lit(1).eq(lit(2)), &schema, &statistics, expected_ret);
+    }
+
+    // Test that always-true literal predicates don't prune any containers
+    #[test]
+    fn row_group_predicate_literal_true() {

Review Comment:
   Added `row_group_predicate_literal_null`



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