-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
support restoring SQL text from a AST tree #8532
Labels
Comments
Waiting this feature to rewriter view's sql...I think we could use create view func to test this feature later. |
This was referenced Dec 4, 2018
zier-one
changed the title
Support to restore SQL text from a AST tree
Support to restore SQL text from a AST tree, Stage One
Dec 4, 2018
zier-one
changed the title
Support to restore SQL text from a AST tree, Stage One
support to restore SQL text from a AST tree
Dec 5, 2018
zier-one
changed the title
support to restore SQL text from a AST tree
support restoring SQL text from a AST tree
Dec 6, 2018
This was referenced Dec 18, 2018
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This was referenced Jan 15, 2019
This was referenced Jan 23, 2019
This was referenced Feb 3, 2019
Merged
Many thanks for your contributions. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: Proposal 中文教程
Our main work is in pingcap/parser/ast.
Most of
ast.Node
s are inpingcap/parser/ast
(Others are inpingcap/tidb/types
).We regard each
ast.Node
as a subtask, and we can complete one or several subtasks as a PR.Considering that some
ast.Node
depends on anotherast.Node
, we divide sub-tasks into five stages.Test
We believe that a
Restore()
function is correct when the SQL text it outputs can be parsed successfullyand the generated AST is equal to the original AST.
See: RunTest and RunRestoreTest
Some
ast.Node
can't be restored to a complete SQL text, such as anast.ExprNode
.To test them, we can construct a complete SQL text.
See: expressions_test.go
There are examples which include complete implementation and test:
parser#71
Sub tasks list:
Stage One:
Stage Two:
Stage Three:
Stage Four:
Stage Five:
The text was updated successfully, but these errors were encountered: