Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(query): pretty format for explain #6585

Merged
merged 2 commits into from
Jul 13, 2022

Conversation

jiaoew1991
Copy link
Contributor

Signed-off-by: Enwei Jiao enwei.jiao@zilliz.com

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

support CockroachDB liked explain format

Fixes #5979

@vercel
Copy link

vercel bot commented Jul 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
databend ✅ Ready (Inspect) Visit Preview Jul 13, 2022 at 5:38AM (UTC)

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Jul 12, 2022
@Xuanwo Xuanwo requested a review from leiysky July 12, 2022 14:01
@leiysky
Copy link
Contributor

leiysky commented Jul 12, 2022

Rest LGTM.

@BohuTANG
Copy link
Member

Hi, there is a test failure:

20_0001_planner_v2:                                                     [ FAIL ] - result differs with:
--- /workspace/tests/suites/0_stateless/20+_others/20_0001_planner_v2.result	2022-07-13 02:18:12.545147220 +0000
+++ /workspace/tests/suites/0_stateless/20+_others/20_0001_planner_v2.stdout	2022-07-13 02:23:42.577675575 +0000
@@ -323,15 +323,15 @@
 9
 ===Explain===
 Project: [a]
-    Filter: [t1.a > 0]
-        Scan: default.default.t1
+└── Filter: [t1.a > 0]
+    └── Scan: default.default.t1
 Filter: [(t1.a > 3) OR ((t2.a > 5) AND (t1.a > 1))]
-    HashJoin: INNER, build keys: [t2.a], probe keys: [t1.a], join filters: []
-        Scan: default.default.t1
-        Scan: default.default.t2
+└── HashJoin: INNER, build keys: [t2.a], probe keys: [t1.a], join filters: []
+    ├── Scan: default.default.t1
+    └── Scan: default.default.t2
 HashJoin: INNER, build keys: [t2.a], probe keys: [t1.a], join filters: []
-    Scan: default.default.t1
-    Scan: default.default.t2
+├── Scan: default.default.t1
+└── Scan: default.default.t2
 ===Explain Pipeline===
 Project × 1 processor
   TransformHashJoin × 1 processor

https://github.com/datafuselabs/databend/runs/7313362524?check_suite_focus=true#step:3:464

@Xuanwo
Copy link
Member

Xuanwo commented Jul 13, 2022

Clippy is not happy:

--> query/src/sql/planner/format/pretty_format.rs:53:61
|
53|                (child_prefix.clone() + LAST_REGULAR_PREFIX).clone(),
| ^^^^^^^^help: remove this
|
= note: `-D clippy::redundant-clone` implied by `-D warnings`
note: this value is dropped without further use
--> query/src/sql/planner/format/pretty_format.rs:53:17
|
53|                (child_prefix.clone() + LAST_REGULAR_PREFIX).clone(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
error: redundant clone
--> query/src/sql/planner/format/pretty_format.rs:54:51
|
54|                (child_prefix + LAST_CHILD_PREFIX).clone(),
| ^^^^^^^^help: remove this
|
note: this value is dropped without further use
--> query/src/sql/planner/format/pretty_format.rs:54:17
|
54|                (child_prefix + LAST_CHILD_PREFIX).clone(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone

Signed-off-by: Enwei Jiao <jiaoew2011@gmail.com>
@Xuanwo
Copy link
Member

Xuanwo commented Jul 13, 2022

@mergify update

@Xuanwo
Copy link
Member

Xuanwo commented Jul 13, 2022

cc @leiysky PTAL

@mergify
Copy link
Contributor

mergify bot commented Jul 13, 2022

update

✅ Branch has been successfully updated

@BohuTANG BohuTANG merged commit 7c3d953 into databendlabs:main Jul 13, 2022
@BohuTANG
Copy link
Member

Thanks for the contribution.

@jiaoew1991 jiaoew1991 deleted the 5979-format branch July 20, 2022 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better display format of EXPLAIN in new planner
4 participants