Skip to content

fix(clickhouse): do not double-escape JSON-encoded fields#4232

Merged
jacobmarble merged 3 commits intomainfrom
jgm-clickhouse-json
Apr 13, 2026
Merged

fix(clickhouse): do not double-escape JSON-encoded fields#4232
jacobmarble merged 3 commits intomainfrom
jgm-clickhouse-json

Conversation

@jacobmarble
Copy link
Copy Markdown
Contributor

Description:

The Clickhouse materializer double-escapes object/array/multiple type columns because

  1. We store those as JSON-encoded strings
  2. Load() depends on Clickhouse functions toJSONString(map(...)) to reconstruct, which does NOT JSON-decode those strings
  3. ... because Clickhouse has no parseJSON or similar function.

Instead, we need to build the top-level JSON string manually by concatenating a bunch of {, }, :, ,, column names, variables, etc.

Workflow steps:

This fixes in the Load() method of the Clickhouse materializer.

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)

@jacobmarble jacobmarble requested a review from a team April 13, 2026 18:53
@jacobmarble jacobmarble force-pushed the jgm-clickhouse-json branch from 990ca09 to 2967154 Compare April 13, 2026 19:06
@jacobmarble jacobmarble merged commit ad5f382 into main Apr 13, 2026
64 of 70 checks passed
@jacobmarble jacobmarble deleted the jgm-clickhouse-json branch April 13, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants