-
Notifications
You must be signed in to change notification settings - Fork 671
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(trino): Support JSON_QUERY #4206
Conversation
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.
What are the advantages of treating this as JSONExtract
? Other dialects also support JSON_QUERY
, possibly with similar semantics. Check T-SQL for example.
@georgesittas For Trino, Afaict, for other dialects like T-SQL |
d78bb2e
to
f6a893c
Compare
Not sure if this is true, I think there are some differences. For example, there's a path that looks like
|
Right, I consider these extra options but at the end both
For T-SQL you'd indeed need Also, in SQLGlot today T-SQL is the only other dialect which has |
Not exactly. Take these T-SQL expressions, for example:
|
f6a893c
to
13f6889
Compare
13f6889
to
43531fc
Compare
Fixes #4200
This PR adds parsing support for Trino's
JSON_QUERY(...)
which is a more powerful version ofJSON_EXTRACT(...)
.For this matter,
exp.JSONExtract
node is reused, but to differentiate between the two a new arg is introduced; This is also required because Presto'sjsonextract_sql
has thevariant_access
logic which must be preserved for Trino.Docs
JSON_QUERY | JSON_EXTRACT