Closed melin closed 8 months ago
We use a hand-written parser library sqlparser-rs so we can't provide an antlr4 syntax file. Would you like to get the table name from SQL? Not sure whether a generic SQL parser can do this @fengjiachun
I'm afraid generic SQL parser cannot handle our extended grammar
I think so. The main database sql antlr4 syntax file is provided here https://github.com/antlr/grammars-v4/tree/master/sql
Are you only parsing the SQL to get the table name? Maybe you can take a look at this.
需要解析ddl和dml 等语句信息,不只表名信息,我们是做一个大数据平台,接入各种数据源,平台统一支持校验权限和血缘, 如果有antlr4语法文件, https://github.com/melin/superior-sql-parser 就考虑加入。
Sorry, we don't have antlr4 syntax files
Our SQL dialect only modifies the syntax of creating table. I can fork an antlr4 syntax from other projects and make it work for greptimedb. Let me try it when I am free.
spark sql is based on the presto antrl syntax file, and doris is based on the spark antlr4 syntax file.
spark sql is based on the presto antrl syntax file, and doris is based on the spark antlr4 syntax file.
Cool, I'll try them. Thank you.
No.
The most significant challenge is that we don't use such Grammar files in code so the compatibility is no guarantee.
ANTLR doesn't have proper Rust impl.
Two ideas we can follow:
This can be an open-ended discussion and I don't think we'd maintain such a file in the main repo.
What problem does the new feature solve?
no
What does the feature do?
Want to use java parsing sql syntax, obtain table information
Implementation challenges
No response