(
scx: &StatementContext,
explain: ExplainTimestampStatement<Aug>,
)
| 1492 | } |
| 1493 | |
| 1494 | pub fn plan_explain_timestamp( |
| 1495 | scx: &StatementContext, |
| 1496 | explain: ExplainTimestampStatement<Aug>, |
| 1497 | ) -> Result<Plan, PlanError> { |
| 1498 | let (format, _verbose_syntax) = match explain.format() { |
| 1499 | mz_sql_parser::ast::ExplainFormat::Text => (ExplainFormat::Text, false), |
| 1500 | mz_sql_parser::ast::ExplainFormat::VerboseText => (ExplainFormat::Text, true), |
| 1501 | mz_sql_parser::ast::ExplainFormat::Json => (ExplainFormat::Json, false), |
| 1502 | mz_sql_parser::ast::ExplainFormat::Dot => (ExplainFormat::Dot, false), |
| 1503 | }; |
| 1504 | |
| 1505 | let raw_plan = { |
| 1506 | let query::PlannedRootQuery { |
| 1507 | expr: raw_plan, |
| 1508 | desc: _, |
| 1509 | finishing: _, |
| 1510 | scope: _, |
| 1511 | } = query::plan_root_query(scx, explain.select.query, QueryLifetime::OneShot)?; |
| 1512 | if raw_plan.contains_parameters()? { |
| 1513 | return Err(PlanError::ParameterNotAllowed( |
| 1514 | "EXPLAIN TIMESTAMP".to_string(), |
| 1515 | )); |
| 1516 | } |
| 1517 | |
| 1518 | raw_plan |
| 1519 | }; |
| 1520 | let when = query::plan_as_of(scx, explain.select.as_of)?; |
| 1521 | |
| 1522 | Ok(Plan::ExplainTimestamp(ExplainTimestampPlan { |
| 1523 | format, |
| 1524 | raw_plan, |
| 1525 | when, |
| 1526 | })) |
| 1527 | } |
| 1528 | |
| 1529 | generate_extracted_config!(SubscribeOption, (Snapshot, bool), (Progress, bool)); |
| 1530 |
no test coverage detected