From babdbb19d69e4c47dc0f7059fd38eb6744202444 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Tue, 22 Oct 2024 16:21:53 +0800 Subject: [PATCH] reject trace, distsql + format json --- e2e_test/batch/explain.slt | 8 +++++++- src/frontend/src/handler/explain.rs | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/e2e_test/batch/explain.slt b/e2e_test/batch/explain.slt index c3f4bfaf32f0e..093adb9e98b55 100644 --- a/e2e_test/batch/explain.slt +++ b/e2e_test/batch/explain.slt @@ -11,4 +11,10 @@ statement ok drop table t; statement error Not supported: EXPLAIN CREATE VIEW -explain create view v as select 1; \ No newline at end of file +explain create view v as select 1; + +statement error explain (trace, distsql, format json) is not supported +explain (trace, format json) select 1; + +statement error explain (trace, distsql, format json) is not supported +explain (distsql, format json) select 1; \ No newline at end of file diff --git a/src/frontend/src/handler/explain.rs b/src/frontend/src/handler/explain.rs index 602aeccfad082..0640ac1c73661 100644 --- a/src/frontend/src/handler/explain.rs +++ b/src/frontend/src/handler/explain.rs @@ -252,6 +252,11 @@ pub async fn handle_explain( if analyze { bail_not_implemented!(issue = 4856, "explain analyze"); } + if (options.trace || options.explain_type == ExplainType::DistSql) + && options.explain_format == ExplainFormat::Json + { + bail_not_implemented!("explain (trace, distsql, format json) is not supported"); + } let mut blocks = Vec::new(); let result = do_handle_explain(handler_args, options.clone(), stmt, &mut blocks).await;