How to view the AST after duckdb's parser? like clickhouse EXPLAIN AST #6922
Replies: 3 comments 11 replies
-
We should probably add this as an option to EXPLAIN, but recently we added json_serialize_sql, which outputs a json serialized statement (that is our AST) So you can use that in the meantime |
Beta Was this translation helpful? Give feedback.
-
Greetings. You could try JSQLParser which understands a lot of SQL. |
Beta Was this translation helpful? Give feedback.
-
FYI, If you're looking for a graphical view or tree view of the json_serialize_sql output: added a mode to magic_duckdb. Only works on the 0.7.2 pre builds.
Demonstration:
** Can also use this directly from Python, via magic_duckdb.extras.ast_graphviz |
Beta Was this translation helpful? Give feedback.
-
like clickhouse EXPLAIN AST
Beta Was this translation helpful? Give feedback.
All reactions