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

Method init_result_columns

ciphercore-base/src/evaluators/join.rs:120–150  ·  view source on GitHub ↗
(join_input: &JoinInput)

Source from the content-addressed store, hash-verified

118
119impl ColumnsMap {
120 fn init_result_columns(join_input: &JoinInput) -> Result<Self> {
121 let has_column_masks = join_input.set0.has_column_masks();
122
123 let num_columns = join_input.result_headers_types.len() - 1;
124 let mut header_index_map: HashMap<String, usize> = HashMap::new();
125 let mut elements_per_row = vec![];
126 let mut ind = 0;
127 for (h, sub_t) in join_input.result_headers_types.iter() {
128 if h == NULL_HEADER {
129 continue;
130 }
131 let column_type = ColumnType::new((**sub_t).clone(), has_column_masks, h)?;
132 elements_per_row.push(column_type.get_row_size_in_elements());
133 header_index_map.insert((*h).clone(), ind);
134 ind += 1;
135 }
136
137 let columns_masks = if has_column_masks {
138 vec![vec![]; num_columns]
139 } else {
140 vec![]
141 };
142
143 Ok(ColumnsMap {
144 header_index_map,
145 null_column: vec![],
146 columns_masks,
147 columns_data: vec![vec![]; num_columns],
148 elements_per_row,
149 })
150 }
151
152 fn append_zero_row(&mut self) {
153 // Add 0 to the null column

Callers

nothing calls this directly

Calls 5

has_column_masksMethod · 0.80
cloneMethod · 0.80
pushMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected