modeldba / antlr4ts-sql

Pre-built SQL grammars that you can import and “just use”. No configuration necessary.
https://modeldba.com/antlr4ts-sql/
MIT License
31 stars 9 forks source link

Support Spark & Presto Sql #1

Open melin opened 2 years ago

melin commented 2 years ago

Spark Antlr4 Files: https://github.com/apache/spark/tree/master/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser

Presto Antlr4 file: https://github.com/prestodb/presto/blob/master/presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4

chengchengpei commented 2 years ago

I am also interested in spark sql, presto sql too

@melin why there is only one g4 file for presto: https://github.com/prestodb/presto/blob/master/presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 ?

melin commented 2 years ago

Lexical and grammar combined in one file

mtriff commented 2 years ago

I would love to add Spark and Presto to this package, but I won't have time to do so over the next while. If you'd like to submit a pull request with the changes, that would be the fastest way to get this implemented. You can follow the docs on building and testing new grammars here.