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

Method concat

src/expr/src/row/collection.rs:98–111  ·  view source on GitHub ↗

Concatenate another [`RowCollection`] onto `self`, copying and reallocating both sets of rows. This does not reorder the rows; the output will be sorted only if the inputs are.

(&mut self, other: &RowCollection)

Source from the content-addressed store, hash-verified

96 ///
97 /// This does not reorder the rows; the output will be sorted only if the inputs are.
98 pub fn concat(&mut self, other: &RowCollection) {
99 if other.count() == 0 {
100 return;
101 }
102
103 // TODO(parkmycar): Using SegmentedBytes here would be nice.
104 let byte_len = self.rows.byte_len() + other.rows.byte_len();
105 let len = self.rows.len() + other.rows.len();
106 let mut builder = Self::builder(byte_len, len);
107 for (row, diff) in self.iter().chain(other.iter()) {
108 builder.push(row, diff);
109 }
110 *self = builder.build();
111 }
112
113 /// Adjust a row count for the provided offset and limit.
114 ///

Callers 3

test_mergeFunction · 0.45
row_collection_mergeFunction · 0.45
render_scopeFunction · 0.45

Calls 6

countMethod · 0.45
byte_lenMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
buildMethod · 0.45

Tested by 1

test_mergeFunction · 0.36