Repository navigation
Conversation
…ty uses anyIf instead of anyIfOrNull on ClickHouse 25.8 (genezhang#1490)
…_integers=0 (whole-number floats no longer come back as integers) (genezhang#1436)
…_integers=0 (whole-number floats no longer come back as integers) (genezhang#1436)
genezhang
left a comment
There was a problem hiding this comment.
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 onmain(git grep quote_64bitfinds only comments). Against a plain 26.7 server the option already returns unquoted 64-bit integers by default. SEMANTIC_SESSION_SETTINGSfeedsportable_sql, so this appends an output-format preference to every piece of ClickHouse SQL we hand out (sql_only,/query/sql, the embeddedquery_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.
|
Closing per maintainer review: the |
What
Fixes #1436: embedded mode with a writable schema without property types stores every property as a string —
writes_e2efails on main becausea.agecomes back asString("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 reads26as 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 = 0toSEMANTIC_SESSION_SETTINGSso all executors (remote, chdb, server) apply it consistently. Also updates theportable_sqltest.Gates (local, 1.94.1,
--no-default-features)Spec-driven
Smallest complete change; backward-compatible. Corpus goldens byte-identical (ratchet green).
Closes #1436