u70b3 commented on code in PR #23707:
URL: https://github.com/apache/datafusion/pull/23707#discussion_r3636439615
##########
datafusion/functions-aggregate/src/first_last.rs:
##########
@@ -1773,6 +1781,116 @@ mod tests {
Ok(())
}
+ /// Rows whose FILTER predicate evaluates to `null` must not pass the
+ /// filter, even when the underlying value bit at the null slot is `true`
+ /// (#22666).
+ #[test]
+ fn test_group_acc_filter_null_predicate() -> Result<()> {
+ let schema = Arc::new(Schema::new(vec![
+ Field::new("a", DataType::Int64, true),
+ Field::new("c", DataType::Int64, true),
+ ]));
+
+ let sort_keys = [PhysicalSortExpr {
+ expr: col("c", &schema).unwrap(),
+ options: SortOptions::default(),
+ }];
+
+ let mut group_acc = FirstLastGroupsAccumulator::try_new(
+ PrimitiveValueState::<Int64Type>::new(DataType::Int64),
+ sort_keys.into(),
+ true,
+ &[DataType::Int64],
+ true,
+ )?;
+
Review Comment:
Fixed, thanks! Added coverage using a sliced nullable BooleanArray with a
non-zero offset.
--
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]