Repository navigation
Fix type_json_allow_duplicated_key_with_literal_and_nested_object not working with typed paths in JSON - #108218
Conversation
…ot working with typed paths in JSON
The setting `type_json_allow_duplicated_key_with_literal_and_nested_object`
was not honored when the JSON type had typed paths (e.g. `JSON(a Int32)`).
Parsing `{"a":42,"a":{"b":42}}::JSON(a Int32)` would throw an exception
about duplicate paths even with the setting enabled.
The fix restructures the object key iteration in `traverseAndInsert` into
two passes:
- First pass: collects distinct element types per key and validates
duplicates upfront (throwing errors before any data is inserted).
- Second pass: processes keys in original order, using a
`skip_typed_path_check` flag for object values of typed non-nested paths
that have a literal+object duplicate. The flag makes the recursive call
enter object traversal instead of trying to insert into the typed path,
so the object's children go to dynamic/shared data while the literal
fills the typed path.
This handles both key orderings correctly (literal-first and object-first).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Workflow [PR], commit [92c93f7] Summary: ✅
AI ReviewSummaryThis PR fixes Findings
Tests
Final VerdictStatus: Minimum required action: fix the structured typed-path duplicate handling and add the missing regression tests. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 51/51 (100.00%) | Lost baseline coverage: none · Uncovered code |
|
Hi — this looks like a backport candidate for |
Backport #108218 to 26.6: Fix `type_json_allow_duplicated_key_with_literal_and_nested_object` not working with typed paths in JSON
Backport #108218 to 26.5: Fix `type_json_allow_duplicated_key_with_literal_and_nested_object` not working with typed paths in JSON
Backport #108218 to 26.3: Fix `type_json_allow_duplicated_key_with_literal_and_nested_object` not working with typed paths in JSON
…ey_with_literal_and_nested_object` not working with typed paths in JSON
…ey_with_literal_and_nested_object` not working with typed paths in JSON
…low-duplicated-key-typed-paths Fix `type_json_allow_duplicated_key_with_literal_and_nested_object` not working with typed paths in JSON
…ey_with_literal_and_nested_object` not working with typed paths in JSON
PROTO: JSON typed paths with the duplicate-key setting -> exc. Effect in the production build a394e92: wrong/failing (the upstream test fails on it and passes on official 26.8.8.8; evidence/fix_ci_20260925/upstream_repro/residual/108218.PROD263.txt). Upstream patch unchanged, with its test(s): 04331_type_json_allow_duplicated_key_with_literal_and_nested_object_typed_paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
type_json_allow_duplicated_key_with_literal_and_nested_objectnot working with typed paths in JSON.Version info
26.7.1.724(included in26.7and later)26.6.3.25,26.5.7.34,26.3.18.23