Skip to content

Add JSON -> JSONB support to the binary driver#229

Open
theory wants to merge 1 commit intomainfrom
binary-json
Open

Add JSON -> JSONB support to the binary driver#229
theory wants to merge 1 commit intomainfrom
binary-json

Conversation

@theory
Copy link
Copy Markdown
Collaborator

@theory theory commented Apr 30, 2026

Requires ClickHouse/clickhouse-cpp#490, here by updating the clickhouse-cpp submodule. Works on ClickHouse 24.10 and higher for the output_format_native_write_json_as_string setting, pass the client to ch_binary_settings() and check the server version.

Update the clickhouse-cpp submodule to f067937, which adds JSON support from ClickHouse/clickhouse-cpp#490. Works on ClickHouse 24.10 and higher for the output_format_native_write_json_as_string setting, pass the client to ch_binary_settings() and check the server version.

Update the tests to ensure that the binary-backed and http-backed JSONB mappings generate the same remote queries and return the same results.

While about things, fix the broken CluckHouse Tutorial links in doc/tutorial.md and add move clang-format to dev/indent.sh so that it runs as part of the pre-commit config, and thus also make lint and the "🔎 Lint" workflow.

@theory theory requested review from serprex and slabko April 30, 2026 04:58
@theory theory self-assigned this Apr 30, 2026
@theory theory added data types Improve data type support drivers Improve binary and/or http driver support dependencies Changes impacted by or requiring changes to dependencies labels Apr 30, 2026
@theory theory force-pushed the binary-json branch 4 times, most recently from 856e069 to 6e1678e Compare May 5, 2026 15:39
@theory theory marked this pull request as ready for review May 6, 2026 01:00
@theory theory force-pushed the binary-json branch 6 times, most recently from 3793684 to 4c7432f Compare May 8, 2026 19:43
Update the clickhouse-cpp submodule to f067937, which adds JSON support
from ClickHouse/clickhouse-cpp#490. Works on ClickHouse 24.10 and higher
for the `output_format_native_write_json_as_string` setting, pass the
client to `ch_binary_settings()` and check the server version.

Add the mappings to `src.binary.cpp` following the usual pattern. Always
convert the ClickHouse JSON to `jsonb` for now; will need to change how
the type OID is passed to `make_datum` before we can properly support
`json`; will fix in a forthcoming commit.

Update the tests to ensure that the binary-backed and http-backed JSONB
mappings generate the same remote queries and return the same results.

While about things, fix the broken CluckHouse Tutorial links in
`doc/tutorial.md` and add move `clang-format` to `dev/indent.sh` so that
it runs as part of the pre-commit config, and thus also `make lint` and
the "🔎 Lint" workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data types Improve data type support dependencies Changes impacted by or requiring changes to dependencies drivers Improve binary and/or http driver support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants