MCPcopy Create free account
hub / github.com/apache/datafusion / groups_with_nulls

Function groups_with_nulls

datafusion/functions-aggregate/src/string_agg.rs:829–852  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

827
828 #[test]
829 fn groups_with_nulls() -> Result<()> {
830 let mut acc = make_groups_acc("|");
831
832 // Group 0: "a", NULL, "c""a|c"
833 // Group 1: NULL, "b""b"
834 // Group 2: NULL only → NULL
835 let values: ArrayRef = Arc::new(LargeStringArray::from(vec![
836 Some("a"),
837 None,
838 Some("c"),
839 None,
840 Some("b"),
841 None,
842 ]));
843 let group_indices = vec![0, 1, 0, 2, 1, 2];
844 acc.update_batch(&[values], &group_indices, None, 3)?;
845
846 let result = evaluate_groups(&mut acc, EmitTo::All);
847 assert_eq!(
848 result,
849 vec![Some("a|c".to_string()), Some("b".to_string()), None,]
850 );
851 Ok(())
852 }
853
854 #[test]
855 fn groups_with_filter() -> Result<()> {

Callers

nothing calls this directly

Calls 4

make_groups_accFunction · 0.85
newFunction · 0.85
evaluate_groupsFunction · 0.85
update_batchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…