-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CrateDB's ANTLR grammar in SQL parser #433
Comments
I think we should move this away from crash and create a separate repo to have the development of antlr4 -> targets. I see two uses cases for the antlr4 targets:
I have already something half-working: input = InputStream('SELECT * FROM sys.shards; SELECT 2;')
lexer = SqlBaseLexer(input)
stream = CommonTokenStream(lexer)
parser = SqlBaseParser(stream)
parse_tree = parser.statements()
print_stmt(parse_tree.statement(0), stream)
print_stmt(parse_tree.statement(1), stream)
|
I don't see a benefit in mixing several targets into a single repo. You just end up with a ton of different build systems. A local admin UI without any backend also seems a bit like a weird use-case. The whole point of the admin UI is to inspect a cluster and run queries. As long as there is only a single consumer it can be inlined, otherwise you're just adding resource maintenance overhead. |
Not being involved in all the relevant details, nor their exact implementations, nor too much on the grammar plumbing side as well, I guess @surister might be referring to the SQL Query Console where such a component / outcome may also be used or relevant in one way or another.
Starting is important, right, I absolutely agree. Maybe I can't still grok this fragment of the discussion, so please support me: Is it just about parallelizing this endeavor to serve the needs of both Python and JavaScript, and finding a right place for this work? |
I tried it and the way targets are created are extremely similar, different targets might potentially share scripts, hence the proposition.
Sorry, when I meant without any backend I meant without Grand Central, our current admin ui embedded with Crate, which of course, CrateDB
Besides the aforementioned use case, cloud already uses sqlparse when proxing queries, enabling running several queries. |
cc @proddata |
I think we should look into replacing sqlparse with a parser generated from the CrateDB antlr grammar, to ensure it supports our SQL dialect.
See https://github.com/antlr/antlr4/blob/4.6/doc/python-target.md
Originally posted by @mfussenegger in #432 (review)
The text was updated successfully, but these errors were encountered: