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

Function groups_merge_batch

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

Source from the content-addressed store, hash-verified

890
891 #[test]
892 fn groups_merge_batch() -> Result<()> {
893 let mut acc = make_groups_acc(",");
894
895 // First batch: group 0 = "a", group 1 = "b"
896 let values: ArrayRef = Arc::new(LargeStringArray::from(vec!["a", "b"]));
897 acc.update_batch(&[values], &[0, 1], None, 2)?;
898
899 // Simulate a second accumulator's state (LargeUtf8 partial strings)
900 let partial_state: ArrayRef = Arc::new(LargeStringArray::from(vec!["c,d", "e"]));
901 acc.merge_batch(&[partial_state], &[0, 1], None, 2)?;
902
903 let result = evaluate_groups(&mut acc, EmitTo::All);
904 assert_eq!(
905 result,
906 vec![Some("a,c,d".to_string()), Some("b,e".to_string())]
907 );
908 Ok(())
909 }
910
911 #[test]
912 fn groups_empty_groups() -> Result<()> {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…