Skip to content

Commit

Permalink
reject trace, distsql + format json
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Oct 22, 2024
1 parent 5bf158c commit babdbb1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion e2e_test/batch/explain.slt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ statement ok
drop table t;

statement error Not supported: EXPLAIN CREATE VIEW
explain create view v as select 1;
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;
5 changes: 5 additions & 0 deletions src/frontend/src/handler/explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit babdbb1

Please sign in to comment.