You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on gegecece and writing SQL parser (ANTLR rule). The main problem is converting parser tree to AST.
AST in SQL is (unresolved) logical plan. There are many ways to define the rule and to traverse the parser tree.
A common pattern is called visitor pattern. However, when looking at code in some dbs e.g. tidb, es. they didn't build the plan in a very visitor way. This post tries to address the following questions
what is visitor pattern, how to implement one (in different languages)
use visitor pattern in ANTLR
not using visitor pattern in ANTLR (when it comes to SQL)
alternative label in ANTLR & visitor
Update
The text was updated successfully, but these errors were encountered:
Type
Related
Description
While working on gegecece and writing SQL parser (ANTLR rule). The main problem is converting parser tree to AST.
AST in SQL is (unresolved) logical plan. There are many ways to define the rule and to traverse the parser tree.
A common pattern is called visitor pattern. However, when looking at code in some dbs e.g. tidb, es. they didn't build the plan in a very visitor way. This post tries to address the following questions
Update
The text was updated successfully, but these errors were encountered: