Mark1626 commented on code in PR #18923:
URL: https://github.com/apache/datafusion/pull/18923#discussion_r2575460532


##########
datafusion/common/src/pruning.rs:
##########
@@ -560,6 +560,79 @@ mod tests {
         assert_eq!(partition_stats.num_containers(), 2);
     }
 
+    #[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 column_a = Column::new_unqualified("a");
+
+        let values = HashSet::from([ScalarValue::from(1i32), 
ScalarValue::from(3i32)]);

Review Comment:
   Given the partition columns are `(a, b)`, the value of `partition_values` in 
the test represent two partitions `(a=1, b=2)` and `(a=3, b=4)`. 
   
   The `contained` is done on an array of column `a` values `[1, 3]`, and not a 
single tuple `(a=1, b=2)`. Which is why the result is `[true, true]`



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