eosphoros-ai / sqlgpt-parser

sqlgpt-parser is a Python implementation of an SQL parser that effectively converts SQL statements into Abstract Syntax Trees (AST). By leveraging AST tree comparisons between two SQL queries, it becomes possible to achieve robust evaluation of text-to-SQL models.
Apache License 2.0
24 stars 9 forks source link

关于sqlgpt-parser的一些问题 #10

Closed ExploreUnknowed closed 2 months ago

ExploreUnknowed commented 5 months ago

作者你好!我想问你一些关于sqlgpt-parser的一些问题,就是在使用解析器将sql语句解析为抽象语法树之后,我们该如何分析这棵抽象语法树呢?或者说,是否提供了对应的api可以帮助遍历抽象语法树,还有就是抽象语法树会以树节点的形式展示关于SQL的更多的细节,那么如何在遍历的过程中判断某些节点是否在原SQL语句中是否存在?比如原SQL语句中没有order by,但是在抽象语法树中会呈现,请问有没有对应的api可以帮助完成这件事情?还有我想问一下,在ast中各节点表示什么含义,比如querybody?哪些节点是父节点,哪些节点是子节点?

github-actions[bot] commented 3 months ago

Stale issue message