ROADMAP v0.5.0 - Alternative WITH clause implementation
(
&self,
with_clause: &WithClause,
input_rows: Vec<Row>,
context: &ExecutionContext,
)
| 1402 | /// Execute a WITH clause without aggregation (fallback for simple cases) |
| 1403 | #[allow(dead_code)] // ROADMAP v0.5.0 - Alternative WITH clause implementation |
| 1404 | fn execute_with_clause_simple( |
| 1405 | &self, |
| 1406 | with_clause: &WithClause, |
| 1407 | input_rows: Vec<Row>, |
| 1408 | context: &ExecutionContext, |
| 1409 | ) -> Result<Vec<Row>, ExecutionError> { |
| 1410 | // Debug output for WITH clause variable scoping issues |
| 1411 | // log::debug!("DEBUG: execute_with_clause_simple called with {} input rows", input_rows.len()); |
| 1412 | log::debug!("Executing simple WITH clause (no aggregation)"); |
| 1413 | |
| 1414 | // Transform each row according to WITH items |
| 1415 | let mut result_rows = Vec::new(); |
| 1416 | |
| 1417 | for input_row in input_rows { |
| 1418 | let mut output_row = Row::new(); |
| 1419 | |
| 1420 | // Evaluate each WITH item |
| 1421 | for with_item in &with_clause.items { |
| 1422 | let value = |
| 1423 | self.evaluate_expression_in_row(&with_item.expression, &input_row, context)?; |
| 1424 | let var_name = with_item.alias.clone().unwrap_or_else(|| { |
| 1425 | // Generate default name if no alias provided |
| 1426 | format!("col_{}", output_row.values.len()) |
| 1427 | }); |
| 1428 | output_row.add_value(var_name, value); |
| 1429 | } |
| 1430 | |
| 1431 | result_rows.push(output_row); |
| 1432 | } |
| 1433 | |
| 1434 | Ok(result_rows) |
| 1435 | } |
| 1436 | |
| 1437 | /// Execute WITH clause by routing through WithClauseProcessor (comprehensive consolidation approach) |
| 1438 | fn execute_with_clause_via_processor( |
nothing calls this directly
no test coverage detected