-
Notifications
You must be signed in to change notification settings - Fork 543
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
accept JSON_TABLE both as an unquoted table name and a table-valued function #1134
Conversation
Pull Request Test Coverage Report for Build 7905402308Details
💛 - Coveralls |
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.
Thank you @lovasoa -- I like this PR a lot
cc @viirya |
EDIT: looks like it is not valid in supported engines as it is reserved keyword. |
@viirya , this PR implements what I had suggested in apache/datafusion#9122 (comment) |
@lovasoa I meant apache/datafusion#9122 (comment) (I think this is what your stand at the beginning). |
Yes, my initial comment was about just ignoring the issue, which did not seem to satisfy everyone. This implements something even better that should make everyone happy. |
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.
Are you sure select * from json_table
is valid in the engines which support json_table table function?
It is a reserved keyword in MySQL: https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-J
As stated above, this PR makes the parser accept BOTH the table identifier and the function in all dialects. I think this is a reasonable behavior. |
I tried running It works in posgres and sqlite |
@alamb : Yes, databases implement either the unquoted table reference syntax, or the table valued function syntax. But sqlparser now implements both. |
👍 |
This is an alternative to #1123
closes #1123
related to apache/datafusion#9122
see #1123 (comment)
This makes sqlparser accept both
And
in all dialects