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

Function merge

datafusion/functions-aggregate/src/string_agg.rs:775–786  ·  view source on GitHub ↗
(
        mut acc1: Box<dyn Accumulator>,
        mut acc2: Box<dyn Accumulator>,
    )

Source from the content-addressed store, hash-verified

773 }
774
775 fn merge(
776 mut acc1: Box<dyn Accumulator>,
777 mut acc2: Box<dyn Accumulator>,
778 ) -> Result<Box<dyn Accumulator>> {
779 let intermediate_state = acc2.state().and_then(|e| {
780 e.iter()
781 .map(|v| v.to_array())
782 .collect::<Result<Vec<ArrayRef>>>()
783 })?;
784 acc1.merge_batch(&intermediate_state)?;
785 Ok(acc1)
786 }
787
788 // ---------------------------------------------------------------
789 // Tests for StringAggGroupsAccumulator

Calls 5

stateMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
to_arrayMethod · 0.45
merge_batchMethod · 0.45

Tested by 8

no_duplicates_distinctFunction · 0.56
duplicates_no_distinctFunction · 0.56
duplicates_distinctFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…