-
Notifications
You must be signed in to change notification settings - Fork 391
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
Consider using proper SQL parser #117
Comments
pretty sure that parser ast tree does not contains info about comments in sql.. but I'm might be wrong. |
You're right. This specific parser completely discards all comments. Should be possible to modify the parser though to also gather info about comments. |
It might have caveats: if the parser is validating, it might not work properly on invalid queries or grammar that it does not know (we had issues with that in Hue SQL Editor). To note that https://github.com/taozhi8833998/node-sql-parser is GPL too. I was surprised on how well sql-format handle big Hive queries, so the current approach has some good sides. Could be a pluggable option to select which parser to use. |
Closing this. That's a larger topic that's in our minds anyway. No real need for an issue to keep track of it. |
Currently the formatter is pretty dumb. It's looking for certain keywords and trying to make some formatting guesses based on these. A better approach would be to use an actual parser like https://github.com/taozhi8833998/node-sql-parser
The text was updated successfully, but these errors were encountered: