Support for native JSON type in JSONExtract* functions. Fixes #88370.#96711
Merged
Avogar merged 19 commits intoClickHouse:masterfrom Feb 25, 2026
Merged
Support for native JSON type in JSONExtract* functions. Fixes #88370.#96711Avogar merged 19 commits intoClickHouse:masterfrom
Avogar merged 19 commits intoClickHouse:masterfrom
Conversation
47003dd to
ffef00f
Compare
Contributor
|
Workflow [PR], commit [30e40a7] Summary: ❌
|
153d656 to
2db08ae
Compare
Contributor
Author
|
@Avogar CI pipeline doesn't seem to be running. I haven't received any update since two days ago. Can you please have a look at it? |
Member
|
Sure, I will look at it later today when I am finished with some important incident. |
…lumnObjectParser.h
Avogar
requested changes
Feb 18, 2026
Member
Avogar
left a comment
There was a problem hiding this comment.
This approach works for some use cases, but it has limitations and problems (see comments). Let me suggest another approach:
- Support
JSONExtract*functions over JSON type only with constant keys arguments with typeString. Supporting non-constant keys and indexes is not trivial, will be complex to implement and will work very slow. And in my opinion, the use cases with indexes and non-constant keys are not common and it's totally ok to skip them for now. - With constant keys we can form a path that we need to extract, here we can use subcolumns to do it, but as I described in one of the comments, we can't just use simple subcolum with dots, we need a combination of a literal subcolumn and subobject subcolumn to be able to extract both literals and nested objects by specified path. Similar how it's done in
tupleElementfunction (seeFunctionTupleElement::getObjectElement). - After extracting and combining subcolumns we can use
accurateCastOrDefaultto convert the values to the destination data type (forJSONExtractRawwe need to do something else, for example, formatting the value as JSON string usingISerialization::serializeTextJSON).
6b2c51a to
32df0eb
Compare
Contributor
Author
|
@Avogar Thanks for the thorough review. I’ve incorporated your suggestions and pushed the updated changes. |
ef253ce to
8606a03
Compare
Avogar
reviewed
Feb 20, 2026
b350e18 to
04b17f7
Compare
Avogar
reviewed
Feb 24, 2026
Member
Avogar
left a comment
There was a problem hiding this comment.
Great work! Just 2 final minor comments and we can merge it
Avogar
approved these changes
Feb 25, 2026
Merged
via the queue into
ClickHouse:master
with commit Feb 25, 2026
98cf010
145 of 148 checks passed
56 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog category:
Changelog entry:
You can now use native JSON/Object input for JSONExtract functions. Closes #88370