MCPcopy Create free account
hub / github.com/ciphermodelabs/ciphercore / copy_entry_from_column

Method copy_entry_from_column

ciphercore-base/src/evaluators/join.rs:174–199  ·  view source on GitHub ↗

Add new elements from a column with a given header to another

(
        &mut self,
        target_header: &str,
        source_header: &str,
        source_columns: &ColumnsMap,
        row_index: usize,
    )

Source from the content-addressed store, hash-verified

172
173 // Add new elements from a column with a given header to another
174 fn copy_entry_from_column(
175 &mut self,
176 target_header: &str,
177 source_header: &str,
178 source_columns: &ColumnsMap,
179 row_index: usize,
180 ) {
181 if target_header == NULL_HEADER && source_header == NULL_HEADER {
182 self.null_column.push(source_columns.null_column[row_index]);
183 return;
184 }
185 let target_index = self.header_index_map[target_header];
186 if source_columns.has_column_masks() {
187 let source_mask_entry = source_columns.get_mask_entry(source_header, row_index);
188 if source_mask_entry == 1 {
189 self.columns_masks[target_index].push(source_mask_entry);
190 let source_entry = source_columns.get_entry(row_index, source_header);
191 self.columns_data[target_index].extend(source_entry);
192 } else {
193 self.append_zero_entry(target_header);
194 }
195 } else {
196 let source_entry = source_columns.get_entry(row_index, source_header);
197 self.columns_data[target_index].extend(source_entry);
198 }
199 }
200
201 fn to_value(&self, join_input: JoinInput) -> Result<Value> {
202 // Collect all columns

Callers 3

get_inner_join_columnsFunction · 0.80
get_left_join_columnsFunction · 0.80
get_union_columnsFunction · 0.80

Calls 6

has_column_masksMethod · 0.80
get_mask_entryMethod · 0.80
get_entryMethod · 0.80
append_zero_entryMethod · 0.80
pushMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected