Skip to content

fix: #1436 chdb executor sets output_format_json_quote_64bit_integers=0 - #1556

Closed
hari2353 wants to merge 5 commits into
genezhang:mainfrom
hari2353:fix/wave2-1436-chdb-json-quote
Closed

hari2353 wants to merge 5 commits into
genezhang:mainfrom
hari2353:fix/wave2-1436-chdb-json-quote

Conversation

@hari2353

@hari2353 hari2353 commented Nov 9, 2026

Copy link
Copy Markdown

What

Fixes #1436: embedded mode with a writable schema without property types stores every property as a string — writes_e2e fails on main because a.age comes back as String("26") instead of an integer.

Root cause: chdb quotes 64-bit integers in JSON by default (output_format_json_quote_64bit_integers=1), so the embedded library reads 26 as a string. The remote ClickHouse executor and server set this to 0; the chdb executor did not.

Fix: add output_format_json_quote_64bit_integers = 0 to SEMANTIC_SESSION_SETTINGS so all executors (remote, chdb, server) apply it consistently. Also updates the portable_sql test.

Gates (local, 1.94.1, --no-default-features)

  • fmt: clean · clippy: clean · lib: 1489/0/4 · ratchet: 1/0

Spec-driven

Smallest complete change; backward-compatible. Corpus goldens byte-identical (ratchet green).

Closes #1436

@genezhang genezhang left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking up #1436. I ran the test from the issue on this head and on main, and unfortunately the setting does not change the outcome.

Evidence. CLICKGRAPH_CHDB_TESTS=1 cargo test -p clickgraph-embedded --features embedded --test writes_e2e (Linux, chdb build): the same 2 of 22 tests fail on main and on this head, with the same assertions: create_node_then_match_back (writes_e2e.rs:92, left: None, right: Some(30)) and set_property_changes_value (:108, left: None, right: Some(26)).

What I think the root cause is. The test schema declares no property_types. resolve_column_type (src/executor/data_loader.rs) returns "String" for a property without one, so the writable table is created with age Nullable(String). The value read back is then a genuine String, whatever the JSON quoting. The guess in the issue ("presumably because chdb's JSON output quotes 64-bit integers") does not hold up. I may be missing something, but I would check SHOW CREATE TABLE persons in that test first. The options I see are declaring property_types: { age: integer } in the test schema, or having the writable DDL infer types from the first write.

Two other points on the change itself

  • The description says the remote executor and the server already set output_format_json_quote_64bit_integers = 0. I could not find that on main (git grep quote_64bit finds only comments). Against a plain 26.7 server the option already returns unquoted 64-bit integers by default.
  • SEMANTIC_SESSION_SETTINGS feeds portable_sql, so this appends an output-format preference to every piece of ClickHouse SQL we hand out (sql_only, /query/sql, the embedded query_to_sql). That list is for settings the results' correctness depends on (join_use_nulls); I would keep wire-format settings out of it.

Stacking. This branch also contains the commit from #1555 (1e1c1b09), so merging it would bring that change in. Please rebase so each PR carries only its own commits.

Please also drop the osv-scanner.toml hunk, which replaces the reason text on main with an older wording. Happy to re-review.

@hari2353

Copy link
Copy Markdown
Author

Closing per maintainer review: the output_format_json_quote_64bit_integers = 0 setting does not change the outcome (verified by maintainer: same 2/22 tests fail on main and on this head). Root cause is that the writable DDL types age as Nullable(String) because the test schema declares no property_types (resolve_column_type returns String). Fix needs either property_types: { age: integer } in the schema or type inference from the first write — a separate change. Also dropping the setting from SEMANTIC_SESSION_SETTINGS per review (wire-format setting doesn't belong there). Leaving #1436 open for that decision.

@hari2353 hari2353 closed this Nov 15, 2026
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.

Embedded: a writable schema without property types stores every property as a string — writes_e2e fails on main

2 participants