-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): support
explain format json
(#19041)
- Loading branch information
Showing
12 changed files
with
401 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/frontend/planner_test/tests/testdata/input/explain_json_format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- name: test json output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format json) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test json output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format json) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test json output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format json) create materialized view m1 as SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output |
147 changes: 147 additions & 0 deletions
147
src/frontend/planner_test/tests/testdata/output/explain_json_format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# This file is automatically generated. See `src/frontend/planner_test/README.md` for more information. | ||
- name: test json output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format json) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
{ | ||
"name": "LogicalAgg", | ||
"fields": { | ||
"aggs": [ | ||
"approx_percentile($expr1)" | ||
] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "LogicalProject", | ||
"fields": { | ||
"exprs": [ | ||
"t.v1::Float64 as $expr1" | ||
] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "LogicalScan", | ||
"fields": { | ||
"columns": [ | ||
"v1" | ||
], | ||
"table": "t" | ||
}, | ||
"children": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
- name: test json output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format json) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
{ | ||
"name": "BatchSimpleAgg", | ||
"fields": { | ||
"aggs": [ | ||
"approx_percentile($expr1)" | ||
] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "BatchExchange", | ||
"fields": { | ||
"dist": "Single", | ||
"order": [] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "BatchProject", | ||
"fields": { | ||
"exprs": [ | ||
"t.v1::Float64 as $expr1" | ||
] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "BatchScan", | ||
"fields": { | ||
"columns": [ | ||
"v1" | ||
], | ||
"table": "t" | ||
}, | ||
"children": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
- name: test json output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format json) create materialized view m1 as SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
{ | ||
"name": "StreamMaterialize", | ||
"fields": { | ||
"columns": [ | ||
"approx_percentile" | ||
], | ||
"pk_columns": [], | ||
"pk_conflict": "NoCheck", | ||
"stream_key": [] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "StreamGlobalApproxPercentile", | ||
"fields": { | ||
"quantile": "0.5:Float64", | ||
"relative_error": "0.01:Float64" | ||
}, | ||
"children": [ | ||
{ | ||
"name": "StreamExchange", | ||
"fields": { | ||
"dist": "Single" | ||
}, | ||
"children": [ | ||
{ | ||
"name": "StreamLocalApproxPercentile", | ||
"fields": { | ||
"percentile_col": "$expr1", | ||
"quantile": "0.5:Float64", | ||
"relative_error": "0.01:Float64" | ||
}, | ||
"children": [ | ||
{ | ||
"name": "StreamProject", | ||
"fields": { | ||
"exprs": [ | ||
"t.v1::Float64 as $expr1", | ||
"t._row_id" | ||
] | ||
}, | ||
"children": [ | ||
{ | ||
"name": "StreamTableScan", | ||
"fields": { | ||
"columns": [ | ||
"v1", | ||
"_row_id" | ||
], | ||
"table": "t" | ||
}, | ||
"children": [] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.