-
Notifications
You must be signed in to change notification settings - Fork 592
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
Support for Clickhouse JSON Extract* Functions #2051
Comments
Hey, thanks for the report. I'll take a look at these JSON functions soon, but I don't think it's currently in scope to add support for all of them. I can add support for |
I'd be happy to! Of the functions I believe |
@BTheunissen I'm a bit skeptical about mapping For instance, the Postgres Perhaps it would help if you shared a bit more context on what you want to transpile it to, but I'm not sure if the ROI of adding this will be worth it. |
I think I was misinterpreting the expression type usage in the codebase as it currently stands. I was hoping that as JSON functions are generally supported across most SQL dialects, we should be able to find a common form of "get an element from this JSON document", and then identify those functions as being interchangeable between SQL dialects, e.g. If mapping functions such as these between dialects is currently not in scope within the project then that is totally understandable. |
Thanks for clarifying.
Your understanding of the
What you're describing makes sense, but it looks like it would require some effort to get right and it's not a high priority at the moment for us. If you want to work on this we could get in touch through Slack. I'll close this as "not planned" for now, may revisit in the future. |
@BTheunissen check out the PR that's linked to this issue, it should address the |
@georgesittas This is fantastic, thank you! Testing this out now. |
Is your feature request related to a problem? Please describe.
Clickhouse supports a series of JSON string member extraction functions as documented here.
It would be helpful for these to be implemented in SQLGlot in a manner which will allow transpilation of Clickhouse queries into other SQL languages that also support JSON manipulation functions, in my current use-case these functions are used quite often for parsing columns containing unstructured data.
Describe the solution you'd like
Support
JSONExtractString
function in Clickhouse dialect (and other appropriate JSON functions supported by Clickhouse that make sense to support in SQLGlot).The text was updated successfully, but these errors were encountered: