Convert rows to positional format for set operations
(&self, rows: Vec<Row>, variables: &[String])
| 7603 | |
| 7604 | /// Convert rows to positional format for set operations |
| 7605 | fn convert_to_positional_rows(&self, rows: Vec<Row>, variables: &[String]) -> Vec<Row> { |
| 7606 | rows.into_iter() |
| 7607 | .map(|row| { |
| 7608 | let mut positional_values = Vec::new(); |
| 7609 | |
| 7610 | // Extract values in variable order for positional comparison |
| 7611 | for var_name in variables { |
| 7612 | if let Some(value) = row.values.get(var_name) { |
| 7613 | positional_values.push(value.clone()); |
| 7614 | } else { |
| 7615 | // If variable not found, use null (shouldn't happen in well-formed queries) |
| 7616 | positional_values.push(Value::Null); |
| 7617 | } |
| 7618 | } |
| 7619 | |
| 7620 | Row::from_positional(positional_values, variables) |
| 7621 | }) |
| 7622 | .collect() |
| 7623 | } |
| 7624 | |
| 7625 | /// Convert rows to positional format, mapping by position rather than by name |
| 7626 | /// Used for set operations where column names may differ but positions must align |
no test coverage detected