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


##########
datafusion/common/src/pruning.rs:
##########
@@ -562,26 +571,32 @@ mod tests {
 
     #[test]
     fn test_partition_pruning_statistics_multiple_positive_values() {
-        let partition_values = vec![
-            vec![ScalarValue::from(1i32), ScalarValue::from(2i32)],
-            vec![ScalarValue::from(3i32), ScalarValue::from(4i32)],
-        ];
-        let partition_fields = vec![
-            Arc::new(Field::new("a", DataType::Int32, false)),
-            Arc::new(Field::new("b", DataType::Int32, false)),
-        ];
-        let partition_stats =
-            PartitionPruningStatistics::try_new(partition_values, 
partition_fields)
-                .unwrap();
+        let partition_stats = partition_pruning_statistics_setup();
 
         let column_a = Column::new_unqualified("a");
 
+        // The two containers have `a` values 1 and 3, so they both only 
contain values from 1 and 3
         let values = HashSet::from([ScalarValue::from(1i32), 
ScalarValue::from(3i32)]);
         let contained_a = partition_stats.contained(&column_a, 
&values).unwrap();
         let expected_contained_a = BooleanArray::from(vec![true, true]);
         assert_eq!(contained_a, expected_contained_a);
     }
 
+    #[test]
+    fn test_partition_pruning_statistics_multiple_negative_values() {
+        let partition_stats = partition_pruning_statistics_setup();
+
+        let column_a = Column::new_unqualified("a");
+
+        // The two containers have `a` values 1 and 3,
+        // so the first contains ONLY values from 1,2
+        // but the second does not
+        let values = HashSet::from([ScalarValue::from(1i32), 
ScalarValue::from(2i32)]);

Review Comment:
   I was confused about  what should happens when the value of `a` isn't in the 
values too, so I added a test



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