-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Presto SQL Parser Now Supports Trailing Commas #23928
base: master
Are you sure you want to change the base?
Conversation
Codenotify: Notifying subscribers in CODENOTIFY files for diff fcac3b4...d5c54a4.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (docs)
Pull branch, local doc build, reviewed all pages in the local doc build. Thanks for the doc!
Hi, @tdcmeehan and/or @elharo does this issue and PR fall within your purview? |
We have taken a principled stand to not deviate from the spec for superficial reasons. So I say no this PR. You can always do these things on the client side. Just because other systems did is not a reason enough. |
Description
This pull request adds support for "trailing commas" in the SQL parser for Presto. This change allows users to include a trailing comma in their SELECT statements, aligning with the style supported by other SQL engines.
Motivation and Context
The change is motivated by two main reasons:
This change addresses the issue "Support Google-style trailing comma in SELECT Support Google-style trailing comma in SELECT #23569". Allowing trailing commas is a minor deviation from ANSI SQL, but it aligns with the style adopted by many programming languages like Python, Rust, and TypeScript, which enhances usability and reduces syntax errors.
Impact
This change introduces a new feature in the SQL parser, allowing trailing commas in SELECT statements. It does not affect existing functionality and is backward compatible.
Test Plan
The change has been tested by adding unit tests that cover various scenarios involving trailing commas in SELECT statements. These tests ensure that the parser correctly handles the new syntax without introducing regressions.
Contributor checklist