Feat(clickhouse): add support for JSONExtractString, clean up some helpers #2925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Several changes here, not necessarily related to each other:
JSONExtractString
, fixes Support for Clickhouse JSON Extract* Functions #2051. Note that clickhouse uses 1-based indexing, so I had to slightly change the logic in some parts to take this into account. Perhaps and interesting observation here is that the dialect offset is not necessarily tied to the JSON path offset._parse_column
into two methods, can elaborate if needed).JSON_EXTRACT
calls. It turns out that I had a bug in my implementation and so previously we'd support up to 3 arguments because of thenull_if_invalid
flag, but 4 would fail. I extended bothJSONExtract
andJSONExtractScalar
to accept arbitrarily many args to amend this.References: