Skip to content

Commit

Permalink
refactor: refactoring graphical by partial method
Browse files Browse the repository at this point in the history
  • Loading branch information
Maricaya committed Sep 29, 2024
1 parent 604e270 commit 5b5b81c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/query/ast/src/parser/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,6 @@ pub fn statement_body(i: Input) -> IResult<Statement> {
#map(query, |query| Statement::Query(Box::new(query)))
| #explain : "`EXPLAIN [PIPELINE | GRAPH] <statement>`"
| #explain_analyze : "`EXPLAIN ANALYZE <statement>`"
| #explain_analyze_graphical : "`EXPLAIN ANALYZE GRAPHICAL <statement>`"
| #show_settings : "`SHOW SETTINGS [<show_limit>]`"
| #show_variables : "`SHOW VARIABLES [<show_limit>]`"
| #show_stages : "`SHOW STAGES`"
Expand Down
2 changes: 0 additions & 2 deletions src/query/ast/src/parser/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@ pub enum TokenKind {
EXISTS,
#[token("EXPLAIN", ignore(ascii_case))]
EXPLAIN,
#[token("GRAPHICAL", ignore(ascii_case))]
GRAPHICAL,
#[token("EXPIRE", ignore(ascii_case))]
EXPIRE,
#[token("EXTRACT", ignore(ascii_case))]
Expand Down
2 changes: 1 addition & 1 deletion src/query/service/src/interpreters/interpreter_explain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ impl ExplainInterpreter {
let result = if self.partial {
format_partial_tree(&plan, metadata, &query_profiles)?.format_pretty()?
} else {
plan.format(metadata.clone(), query_profiles)?
plan.format(metadata.clone(), query_profiles.clone())?
.format_pretty()?
};
let line_split_result: Vec<&str> = result.lines().collect();
Expand Down
3 changes: 3 additions & 0 deletions src/query/service/src/interpreters/interpreter_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,23 @@ impl InterpreterFactory {
kind.clone(),
config.clone(),
false,
false,
)?)),
Plan::ExplainAst { formatted_string } => Ok(Arc::new(ExplainInterpreter::try_create(
ctx,
plan.clone(),
ExplainKind::Ast(formatted_string.clone()),
ExplainConfig::default(),
false,
false,
)?)),
Plan::ExplainSyntax { formatted_sql } => Ok(Arc::new(ExplainInterpreter::try_create(
ctx,
plan.clone(),
ExplainKind::Syntax(formatted_sql.clone()),
ExplainConfig::default(),
false,
false,
)?)),
Plan::ExplainAnalyze { graphical, partial, plan } => Ok(Arc::new(ExplainInterpreter::try_create(
ctx,
Expand Down

0 comments on commit 5b5b81c

Please sign in to comment.