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,
)
| 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 |
no test coverage detected