Skip to content
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

Feat(oracle): add support for JSON_TABLE #2191

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Sep 11, 2023

Fixes #2187

Note that the COLUMNS clause requires parentheses according to Oracle's spec, so right now the form COLUMNS ... without parentheses fails, cc @sashindeitidata are you sure your queries are valid Oracle SQL w.r.t. this? If they are, then this should be an easy fix (i.e. not requiring parens).

The JSON_TABLE hasn't been fully implemented, and also JSON_VALUE is still parsed into an Anonymous. I believe the issue should be addressed with these PRs. We'll be happy to accept contributions related to improving support for these functions. I think adding full support is out of scope for the time being.

Reference: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_TABLE.html

Comment on lines +4530 to +4531
class JSONColumnDef(Expression):
arg_types = {"this": True, "kind": False, "path": False}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't reuse ColumnDef on purpose here, because there are several JSON Column Defn. -specific args that we might need to add in the future, if we decide to improve support for this, so I didn't want to pollute the former by adding these args to it.

@tobymao tobymao merged commit f4e3e09 into main Sep 11, 2023
@tobymao tobymao deleted the jo/oracle_json_table branch September 11, 2023 20:30
@sashindeitidata
Copy link

Fixes #2187

Note that the COLUMNS clause requires parentheses according to Oracle's spec, so right now the form COLUMNS ... without parentheses fails, cc @sashindeitidata are you sure your queries are valid Oracle SQL w.r.t. this? If they are, then this should be an easy fix (i.e. not requiring parens).

The JSON_TABLE hasn't been fully implemented, and also JSON_VALUE is still parsed into an Anonymous. I believe the issue should be addressed with these PRs. We'll be happy to accept contributions related to improving support for these functions. I think adding full support is out of scope for the time being.

Reference: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_TABLE.html

Hi @georgesittas

Shared queries are valid and works fine when we tested. COLUMNS ... without parentheses works fine too.
It would be great if you could add support for the same as well.

Thanks, Sachin

@georgesittas
Copy link
Collaborator Author

georgesittas commented Sep 12, 2023

Fixes #2187
Note that the COLUMNS clause requires parentheses according to Oracle's spec, so right now the form COLUMNS ... without parentheses fails, cc @sashindeitidata are you sure your queries are valid Oracle SQL w.r.t. this? If they are, then this should be an easy fix (i.e. not requiring parens).
The JSON_TABLE hasn't been fully implemented, and also JSON_VALUE is still parsed into an Anonymous. I believe the issue should be addressed with these PRs. We'll be happy to accept contributions related to improving support for these functions. I think adding full support is out of scope for the time being.
Reference: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_TABLE.html

Hi @georgesittas

Shared queries are valid and works fine when we tested. COLUMNS ... without parentheses works fine too. It would be great if you could add support for the same as well.

Thanks, Sachin

Fixed in 5d0559b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to parse the oracle query when query has JSON components
3 participants