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

Function groups_basic

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

Source from the content-addressed store, hash-verified

805
806 #[test]
807 fn groups_basic() -> Result<()> {
808 let mut acc = make_groups_acc(",");
809
810 // 6 rows, 3 groups: group 0 gets "a","d"; group 1 gets "b","e"; group 2 gets "c","f"
811 let values: ArrayRef =
812 Arc::new(LargeStringArray::from(vec!["a", "b", "c", "d", "e", "f"]));
813 let group_indices = vec![0, 1, 2, 0, 1, 2];
814 acc.update_batch(&[values], &group_indices, None, 3)?;
815
816 let result = evaluate_groups(&mut acc, EmitTo::All);
817 assert_eq!(
818 result,
819 vec![
820 Some("a,d".to_string()),
821 Some("b,e".to_string()),
822 Some("c,f".to_string()),
823 ]
824 );
825 Ok(())
826 }
827
828 #[test]
829 fn groups_with_nulls() -> 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…