-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support xml, yaml format in explain output
- Loading branch information
Showing
12 changed files
with
196 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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_xml_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 xml output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format xml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test xml output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format xml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test xml output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format xml) create materialized view m1 as SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output |
18 changes: 18 additions & 0 deletions
18
src/frontend/planner_test/tests/testdata/input/explain_yaml_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 yaml output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format yaml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test yaml output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format yaml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output | ||
- name: test yaml output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format yaml) create materialized view m1 as SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
expected_outputs: | ||
- explain_output |
19 changes: 19 additions & 0 deletions
19
src/frontend/planner_test/tests/testdata/output/explain_xml_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,19 @@ | ||
# This file is automatically generated. See `src/frontend/planner_test/README.md` for more information. | ||
- name: test xml output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format xml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
<XmlNode><name>LogicalAgg</name><fields><aggs>approx_percentile($expr1)</aggs></fields><children><name>LogicalProject</name><fields><exprs>t.v1::Float64 as $expr1</exprs></fields><children><name>LogicalScan</name><fields><columns>v1</columns><table>t</table></fields></children></children></XmlNode> | ||
- name: test xml output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format xml) SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
<XmlNode><name>BatchSimpleAgg</name><fields><aggs>approx_percentile($expr1)</aggs></fields><children><name>BatchExchange</name><fields><dist>Single</dist></fields><children><name>BatchProject</name><fields><exprs>t.v1::Float64 as $expr1</exprs></fields><children><name>BatchScan</name><fields><columns>v1</columns><table>t</table></fields></children></children></children></XmlNode> | ||
- name: test xml output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format xml) create materialized view m1 as SELECT approx_percentile(0.5) WITHIN GROUP (order by v1) from t; | ||
explain_output: | | ||
<XmlNode><name>StreamMaterialize</name><fields><columns>approx_percentile</columns><pk_conflict>NoCheck</pk_conflict></fields><children><name>StreamGlobalApproxPercentile</name><fields><quantile>0.5:Float64</quantile><relative_error>0.01:Float64</relative_error></fields><children><name>StreamExchange</name><fields><dist>Single</dist></fields><children><name>StreamLocalApproxPercentile</name><fields><percentile_col>$expr1</percentile_col><quantile>0.5:Float64</quantile><relative_error>0.01:Float64</relative_error></fields><children><name>StreamProject</name><fields><exprs>t.v1::Float64 as $expr1</exprs><exprs>t._row_id</exprs></fields><children><name>StreamTableScan</name><fields><columns>v1</columns><columns>_row_id</columns><table>t</table></fields></children></children></children></children></children></XmlNode> |
89 changes: 89 additions & 0 deletions
89
src/frontend/planner_test/tests/testdata/output/explain_yaml_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,89 @@ | ||
# This file is automatically generated. See `src/frontend/planner_test/README.md` for more information. | ||
- name: test yaml output format (logical) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (logical, format yaml) 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 yaml output format (batch) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format yaml) 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 yaml output format (stream) | ||
sql: | | ||
CREATE TABLE t (v1 int); | ||
explain (physical, format yaml) 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -582,7 +582,9 @@ define_keywords!( | |
WITHOUT, | ||
WORK, | ||
WRITE, | ||
XML, | ||
XOR, | ||
YAML, | ||
YEAR, | ||
ZONE | ||
); | ||
|
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