dqkqd commented on code in PR #18923:
URL: https://github.com/apache/datafusion/pull/18923#discussion_r2561565774
##########
datafusion/common/src/pruning.rs:
##########
@@ -560,6 +560,28 @@ mod tests {
assert_eq!(partition_stats.num_containers(), 2);
}
+ #[test]
+ fn test_partition_pruning_statistics_multiple_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)]);
+ let contained_a = partition_stats.contained(&column_a,
&values).unwrap();
+ let expected_contained_a = BooleanArray::from(vec![true, true]);
Review Comment:
The stats:
| a | b |
| - | - |
| 1 | 2 |
| 3 | 4 |
Running `contained` on `a` with `values = [1, 3]` returns `[true, true]`.
I wonder if we need some cases that return `false`, or `None` as well.
--
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]