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(planner): support explain syntax #7124

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Aug 15, 2022

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

Summary

Support explain syntax.
Inspired by forma, use pretty to output the formatted SQL

#7063

@b41sh b41sh requested review from sundy-li and leiysky August 15, 2022 08:29
@vercel
Copy link

vercel bot commented Aug 15, 2022

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

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Aug 17, 2022 at 1:27AM (UTC)

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Aug 15, 2022
@sundy-li sundy-li requested a review from xudong963 August 15, 2022 09:00
src/query/ast/src/ast/format/syntax/mod.rs Outdated Show resolved Hide resolved
src/query/ast/src/ast/format/syntax/query.rs Outdated Show resolved Hide resolved
src/query/ast/src/ast/format/syntax/query.rs Outdated Show resolved Hide resolved
@leiysky
Copy link
Contributor

leiysky commented Aug 15, 2022

I think the new pretty function is actually a reimplementation of Display of AST, is it possible to replace the current implementation of Display with pretty?

@b41sh
Copy link
Member Author

b41sh commented Aug 15, 2022

I think the new pretty function is actually a reimplementation of Display of AST, is it possible to replace the current implementation of Display with pretty?

yes, we can use pretty to replace Display.

@BohuTANG
Copy link
Member

yes, we can use pretty to replace Display.

Will do it in this PR or not?

@b41sh
Copy link
Member Author

b41sh commented Aug 17, 2022

yes, we can use pretty to replace Display.

Will do it in this PR or not?

In a new PR, a lot work need to do.

@BohuTANG
Copy link
Member

Following failed statements:
---------------------------------------------
Runner: mysql
ErrorType: statement query get result not equal to expected
Message: 
 Expected:
SELECT
    1,
    'ab',
    [1, 2, 3],
    (1, 'a')                             
 Actual:
EXPLAIN SYNTAX SELECT 1, 'ab', [1, 2, 3], (1, 'a')                              
 Statement:
Parsed Statement
    at_line: 71,
    s_type: Statement: query, type: T, query_type: T, retry: False,
    suite_name: standalone/04_0002_explain_v2,
    text:
        explain syntax explain syntax select 1, 'ab', [1,2,3], (1, 'a');
    results: [(<re.Match object; span=(0, 4), match='----'>, 79, "SELECT\n    1,\n    'ab',\n    [1, 2, 3],\n    (1, 'a')")],
    runs_on: {'mysql'},
 Start Line: 79, Result Label: 

@b41sh b41sh force-pushed the feat-explain-syntax branch from 9396bd5 to 85a2bde Compare August 17, 2022 01:26
@BohuTANG BohuTANG merged commit 8d11a46 into databendlabs:main Aug 17, 2022
@BohuTANG
Copy link
Member

cc @soyeric128 for explain syntax statement documentation.

@BohuTANG BohuTANG mentioned this pull request Aug 19, 2022
43 tasks
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.

4 participants