Repository navigation
setting to control type mismatch behavior for variant and dynamic - #99085
Conversation
|
Workflow [PR], commit [c9ef26a] Summary: ⏳
AI ReviewSummaryThis PR introduces Findings💡 Nits
ClickHouse Rules
Final Verdict
|
Avogar
left a comment
There was a problem hiding this comment.
Changes looks good to me, but we need to fix build and add new tests for these settings
436f2a0 to
53f539d
Compare
53f539d to
335332b
Compare
8f89f43 to
acaa13b
Compare
4b2e3bf to
a94334c
Compare
|
|
||
| ### Type mismatch behavior {#variant-type-mismatch-behavior} | ||
|
|
||
| The setting `variant_throw_on_type_mismatch` controls what happens when a function is applied to a `Variant` column and the actual stored type of a row is incompatible with the function: |
There was a problem hiding this comment.
This new section documents variant_throw_on_type_mismatch=true as default throwing behavior, but the existing note a few lines above still says type-related errors are caught and converted to NULL.
Could you update that note to mention it applies only when variant_throw_on_type_mismatch = false? Otherwise readers will get contradictory behavior descriptions on the same page.
LLVM Coverage Report
Changed lines: 87.16% (95/109) | lost baseline coverage: 1 line(s) · Uncovered code |
|
@bharatnc what do you think about backporting it to 26.3 where we added default implementation for Variant for consistency? |
sure, we can backport. |
Cherry pick #99085 to 26.3: setting to control type mismatch behavior for variant and dynamic
…r variant and dynamic
Backport #99085 to 26.3: setting to control type mismatch behavior for variant and dynamic
Dependency of the ClickHouse#100939 backport (e1f3ced0221): its code reads the setting variant_throw_on_type_mismatch that this change adds, so e1f3ced0221 does not compile without it (found by the candidate build: FunctionVariantAdaptor.cpp, undeclared Setting::variant_throw_on_type_mismatch). The 26.3 branch merged this backport on 2026-06-17, before the ClickHouse#100939 backport. The default (true) keeps the behaviour (SettingsChangesHistory: true -> true): a function applied to a Variant/Dynamic row of an incompatible type throws; setting it to false returns NULL instead. Upstream patch unchanged, with its test 04101_variant_dynamic_type_mismatch_settings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…f upstream fixes The stateless selection gets the upstream tests of the 34 backports of the residual audit and of the two backports they depend on (ClickHouse#99085, ClickHouse#107562), 04627 (runnable with the gate's loopback Keeper), and 10317/10318 (Parquet Decimal512): 152 tests. 04670 (needs pyarrow) and 00900 (a long load test whose skip list changed) run outside the gate. known_defects.json: a fixed KD-UP entry per backport (fixed_by = its commit); KD-UP-108790 points at the ClickHouse#115705 backport, which carries its change; KD-UP-107663 records its ClickHouse#112601 dependency. Defects found by the release gate on the candidate 91efe1f244ce and fixed: KD-D512-PERF-OVERFLOW-CHECKS (e91167f), KD-TEST-BLOCKCHAIN-TYPENAME (f006d0d), KD-GATE-NO-KEEPER (095b89c). 80 entries, 0 open. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add a setting to control type mismatch behavior for variant and dynamic (throw or return null).
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add a setting to control type mismatch behavior for variant and dynamic (throw or return null).
Documentation entry for user-facing changes
Version info
26.4.1.106826.3.14.33