MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / union

Method union

src/expr/src/relation.rs:1433–1453  ·  view source on GitHub ↗

Produces one collection where each row is present with the sum of its frequencies in each input.

(self, other: Self)

Source from the content-addressed store, hash-verified

1431
1432 /// Produces one collection where each row is present with the sum of its frequencies in each input.
1433 pub fn union(self, other: Self) -> Self {
1434 // Deconstruct `self` and `other` as `Union`s and reconstitute.
1435 let mut flat_inputs = Vec::with_capacity(2);
1436 if let MirRelationExpr::Union { base, inputs } = self {
1437 flat_inputs.push(*base);
1438 flat_inputs.extend(inputs);
1439 } else {
1440 flat_inputs.push(self);
1441 }
1442 if let MirRelationExpr::Union { base, inputs } = other {
1443 flat_inputs.push(*base);
1444 flat_inputs.extend(inputs);
1445 } else {
1446 flat_inputs.push(other);
1447 }
1448
1449 MirRelationExpr::Union {
1450 base: Box::new(flat_inputs.remove(0)),
1451 inputs: flat_inputs,
1452 }
1453 }
1454
1455 /// Arranges the collection by the specified columns
1456 pub fn arrange_by(self, keys: &[Vec<MirScalarExpr>]) -> Self {

Callers 4

lookupMethod · 0.45
typMethod · 0.45
test_interpretFunction · 0.45

Calls 3

pushMethod · 0.45
extendMethod · 0.45
removeMethod · 0.45

Tested by 1

test_interpretFunction · 0.36