accept JSON_TABLE both as an unquoted table name and a table-valued function#1134
accept JSON_TABLE both as an unquoted table name and a table-valued function#1134alamb merged 6 commits intoapache:mainfrom
Conversation
Pull Request Test Coverage Report for Build 7905402308Details
💛 - Coveralls |
|
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. |
viirya
left a comment
There was a problem hiding this comment.
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