kosiew commented on code in PR #23707:
URL: https://github.com/apache/datafusion/pull/23707#discussion_r3636170891
##########
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:
Could we also add a case where the nullable `BooleanArray` is sliced to a
non-zero offset before calling `update_batch`? That would help explicitly cover
the bitmap-offset boundary involved in the new validity and value checks. The
current implementation already uses Arrow's offset-aware accessors correctly,
so this is only a test-hardening suggestion.
--
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]