-
Notifications
You must be signed in to change notification settings - Fork 765
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
[Tracking] Refactor SQL Parser #1218
Labels
C-improvement
Category: improvement
Comments
Related to #866 |
This was referenced Jul 28, 2021
I've just filed a PR #1478, which introduces a bunch of Datafuse standard SQL AST and a transformer from Welcome to review and comment. |
This was referenced Aug 19, 2021
Closed
The tokenizer has been introduced in #4024 |
This was referenced Apr 20, 2022
Closed by #4983 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Part of #1217
Background
To provide a more generic parser abstraction, we need to do some refactor on the current implementation.
Generally, all of the SQL dialects follow some basic rules, with which we can design our own SQL IR(i.e. datafuse specific AST).
With this IR, we can transform the SQL queries in different dialects into the same representation.
The major idea is provide series of standard AST of Datafuse that can be directly parsed from Datafuse SQL dialect. The elements can be catagorized as:
Expression
s, represents expression entries in a SQL query including identifier, arithmetic operators and functions etc.Statement
s, represents SQL clauses, includingSELECT
,FROM
,WHERE
,GROUP BY
,HAVING
,ORDER BY
,LIMIT
and DDL statements.Beyond this, we can provide interface likeASTTransformer
to transform AST produced by other parsers(e.g. MySQL, ClickHouse, Postgres) into the standard AST.Update: 2021.8.20
We have introduced a series of standard AST API in #1478 .
The main work during this stage is:
Tasks
High priority:
Visitor
utility for AST @jackwener ImplementVisitor
for SQL AST #1511Low priority:
TransformerSqlparser
@SGZW ImplementTransformerSqlparser::transform_ddl
#1512The text was updated successfully, but these errors were encountered: