Builds the wide schema by laying out the suffix-renamed zero-padded copies first and the unsuffixed base columns last. Putting the base columns at the *end* of the schema is deliberate — column lookup for the filter / project columns has to traverse past all the padding entries, exercising any per-column-position cost in the scanner / planner.
(src: &SchemaRef, factor: usize)
| 187 | /// padding entries, exercising any per-column-position cost in the |
| 188 | /// scanner / planner. |
| 189 | fn widen_schema(src: &SchemaRef, factor: usize) -> SchemaRef { |
| 190 | let src_fields = src.fields(); |
| 191 | let mut fields: Vec<Arc<Field>> = Vec::with_capacity(src_fields.len() * factor); |
| 192 | for copy in 2..=factor { |
| 193 | for f in src_fields { |
| 194 | fields.push(Arc::new(Field::new( |
| 195 | format!("{}_{}", f.name(), copy), |
| 196 | f.data_type().clone(), |
| 197 | true, |
| 198 | ))); |
| 199 | } |
| 200 | } |
| 201 | for f in src_fields { |
| 202 | fields.push(Arc::new(Field::new( |
| 203 | f.name().clone(), |
| 204 | f.data_type().clone(), |
| 205 | f.is_nullable(), |
| 206 | ))); |
| 207 | } |
| 208 | Arc::new(Schema::new(fields)) |
| 209 | } |
| 210 | |
| 211 | fn widen_batch( |
| 212 | batch: &RecordBatch, |
no test coverage detected
searching dependent graphs…