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

Function merge

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

Source from the content-addressed store, hash-verified

1612 }
1613
1614 fn merge(
1615 mut acc1: Box<dyn Accumulator>,
1616 mut acc2: Box<dyn Accumulator>,
1617 ) -> Result<Box<dyn Accumulator>> {
1618 let intermediate_state = acc2.state().and_then(|e| {
1619 e.iter()
1620 .map(|v| v.to_array())
1621 .collect::<Result<Vec<ArrayRef>>>()
1622 })?;
1623 acc1.merge_batch(&intermediate_state)?;
1624 Ok(acc1)
1625 }
1626
1627 // ---- GroupsAccumulator tests ----
1628

Calls 5

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…