Skip to content

Render a typed constant converted to String with its own text serialization - #118372

Open
alexey-milovidov wants to merge 54 commits into
masterfrom
string-set-from-typed-constant-117240
Open

alexey-milovidov wants to merge 54 commits into
masterfrom
string-set-from-typed-constant-117240

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 6, 2026 •

Copy link
Copy Markdown
Member

Converting a constant of another type to String - which is what building the set of IN against a String column does, and what the values table function does - fell back to the query-literal formatter. For several types that is not the value's text at all: a Date came out as its raw day number, a Float64 as 1., and a UUID, IPv4, IPv6, DateTime64 or Decimal carried the quote characters of the literal inside the string.

SELECT toString(toDate('2020-01-01')) IN (toDate('2020-01-01'));  -- 0, was wrong
SELECT '18262' IN (toDate('2020-01-01'));                         -- 1, was wrong
SELECT '1.2.3.4' IN (toIPv4('1.2.3.4'));                          -- 0, was wrong
SELECT '1' IN (toFloat64(1));                                     -- 0, was wrong
SELECT x FROM values('x String', toDate('2020-01-01'));           -- '18262', was wrong

IN therefore disagreed with CAST(x AS String) and toString - and over a table it dropped the row that should match while returning one that should not.

The conversion now renders the value with the text serialization of the source type, as the Enum case added by #112647 already did for the same reason ("IN must agree with CAST"); the literal formatter stays for a constant whose source type is unknown.

A FixedString constant is deliberately left alone: it has no rendering problem - its Field already
holds its bytes - what it has is the separate question of whether IN adopts the zero-padding
equivalence of the comparison functions. convertFieldToType is also how the skip indexes derive the
value to hash, and convertConstantForArrayIndexFunction in MergeTreeIndexBloomFilter.cpp relies on
the padded form to match the raw-byte comparison of arrayIndex.h executeString, so trimming here
makes the index prune rows the function matches.

The rendering uses the query's format settings exactly where CAST(x AS String) uses them: CAST
writes numbers, decimals, dates and times with fixed text (FormatImpl in FunctionsConversion.h), so
date_time_output_format changes neither CAST nor the set, while it serializes the other types with
the session settings, so 'yes' IN (true) is 1 under bool_true_representation = 'yes', as
CAST(true AS String) is yes. The set of IN and the values table function both receive the
settings from the query context.

Closes: #117240
Related: #112647
Related: #116852

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fixed IN against a String column with a constant of another type (Date, DateTime, UUID, IPv4, IPv6, Decimal, Float) matching the wrong rows: the set held the query-literal rendering of the constant (a Date as its day number, an IPv4 with quote characters) instead of the text that CAST(x AS String) produces. The values table function is fixed the same way.


Workflow [PR]
Sync PR [sync-upstream/pr/118372]

…zation

Converting a constant of another type to `String` - which is what building the
set of `IN` against a `String` column does, and what the `values` table function
does - fell back to the query-literal formatter. For several types that is not
the value's text at all: a `Date` came out as its raw day number, a `Float64` as
`1.`, and a `UUID`, `IPv4`, `IPv6`, `DateTime64` or `Decimal` carried the quote
characters of the literal inside the string.

    SELECT toString(toDate('2020-01-01')) IN (toDate('2020-01-01'));  -- 0
    SELECT '18262' IN (toDate('2020-01-01'));                         -- 1
    SELECT '1.2.3.4' IN (toIPv4('1.2.3.4'));                          -- 0
    SELECT x FROM values('x String', toDate('2020-01-01'));           -- '18262'

`IN` therefore disagreed with `CAST(x AS String)` and `toString`, and over a
table it dropped the row that should match while returning one that should not.

The conversion now renders the value with the text serialization of the source
type, as the `Enum` case added by #112647 already did for the same reason - the
literal formatter stays for a constant whose source type is unknown.

Closes: #117240

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e6e3175]

Summary: ✅


AI Review

Summary

Reviewed head e6e31755f60e4799f0f785bac8dcfa517a49fdf9, the complete diff, and all prior discussion. The PR fixes typed constant rendering to String for IN and values, preserving source types and query format settings through composite conversions, the VALUES expression parser, external predicate rewriting, and dictionary default probes. Earlier findings are addressed or have an accepted, tracked scope decision. No unresolved material findings remain. Five focused regression tests (05100, 05398, 05399, 05616, and 05617) passed and exactly matched their references using the current head's Fast test binary.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. labels Sep 6, 2026
Comment thread src/Interpreters/convertFieldToType.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing e6e31755f with master 0b5613b71 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

19 object files changed (+199.80 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Interpreters/convertColumnToType.cpp.o 460.04 KiB 561.80 KiB +101.77 KiB (+22.12%)
src/CMakeFiles/dbms.dir/Processors/Formats/Impl/ValuesBlockInputFormat.cpp.o 343.56 KiB 398.47 KiB +54.91 KiB (+15.98%)
src/CMakeFiles/dbms.dir/Interpreters/convertFieldToType.cpp.o 542.41 KiB 564.55 KiB +22.14 KiB (+4.08%)
src/CMakeFiles/dbms.dir/Storages/transformQueryForExternalDatabaseAnalyzer.cpp.o 195.50 KiB 216.55 KiB +21.06 KiB (+10.77%)

716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

88 translation units recompiled, 518 s compile time in total, 88 of them have a recent master baseline.

Job report

Comment thread src/Interpreters/convertFieldToType.cpp Resolved
alexey-milovidov and others added 3 commits September 18, 2026 11:08
…e `CAST` uses them

Address review: the set of `IN` and the `values` table function converted a typed constant to
`String` with default `FormatSettings`, while `CAST(x AS String)` in the same query uses the
session's settings for the types it serializes generically, so `'yes' IN (true)` was `0` under
`bool_true_representation = 'yes'` although `CAST(true AS String)` is `yes`.

`GetSetElementParams` now carries the query's `FormatSettings` (filled from the context in
`CollectSets`, `ActionsVisitor` and the constant-folding path of `resolveFunction`), and
`TableFunctionValues` passes them too. `convertFieldToType` applies them exactly where `CAST`
does: numbers, decimals, dates and times keep the fixed text of `FormatImpl` in
`FunctionsConversion.h`, so `date_time_output_format` changes neither `CAST` nor the set, and
every other type is serialized with the query's settings.

The test pins both halves: `DateTime` under `date_time_output_format = 'unix_timestamp'` and
`Bool` under `bool_true_representation = 'yes'`, for scalar and tuple `IN`, `values` and a
table query.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
`date_time_output_format` is not an example of a setting that applies: `CAST` renders a
`DateTime` with fixed text, and the set follows `CAST`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Comment thread src/Interpreters/convertFieldToType.cpp Resolved
Comment thread src/Interpreters/convertFieldToType.cpp Resolved
alexey-milovidov and others added 4 commits September 25, 2026 19:41
…tFieldToType`

The `Array`, `Tuple` and `Map` branches recursed with a `nullptr` type hint, so a nested
element converted to `String` fell back to the query-literal formatter:
`values('x Array(String)', [toDate('2020-01-01')])` gave `['18262']` and
`['2020-01-01'] IN ([toDate('2020-01-01')])` was `0`, while `CAST` gives `['2020-01-01']`.
Now the nested element, key and value types of a matching source type are passed down.

The test also pins that `output_format_decimal_trailing_zeros` does not reach the set, as
in `CAST` (a `Decimal` is already classified as fixed text by `WhichDataType::isNumber`).

Address review: #118372

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…type hint

The `Array`/`Tuple`/`Map` recursion of `convertFieldToType` now passes the source element
type down, so an `Enum` element inside an array converted to `String` gets its name, not its
number. The test pinned the old (wrong) value as a known limitation; assert the correct one.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=26f8cb226b94c264205a3d8522b6110e9275d7f2&name_0=PR&name_1=Fast%20test
PR: #118372

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Interpreters/convertFieldToType.cpp Resolved
alexey-milovidov and others added 2 commits October 4, 2026 19:02
…ames

`GetSetElementParams` now holds `FormatSettings`, which is large. It was
constructed inline in `CollectSetsVisitor::enterImpl`, which is inlined into
the recursive `InDepthQueryTreeVisitorWithContext::visit`, so every level of
recursion carried it. On the deep expression of
`04041_defaults_long_dependency` (a chain of 1000 `DEFAULT` columns) this
overflowed the stack in `Stateless tests (arm_binary, parallel)`.

Add an overload of `getSetElementsForConstantValue` that takes the context
and builds the parameters itself, out of line, and use it from
`CollectSetsVisitor`, `QueryAnalyzer::resolveFunction` and `ActionsVisitor`.
The parameters are passed by reference inside `SetUtils.cpp`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=fc3d72a385d845647adb4a81416fd41f0b141434&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
#118372

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e branches of `convertFieldToType`

`convertFieldToType` unwraps only the target `Nullable`, so for a source of
type `Nullable(Tuple(Date, UUID))` the tuple branch got the wrapped hint, the
`typeid_cast` to `DataTypeTuple` failed, and the elements were rendered as
query literals again. Unwrap `Nullable` and `LowCardinality` from the hint in
the `Array`, `Tuple` and `Map` branches as the `String` branch already does,
and add a regression to `05100_string_set_from_typed_constant`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CI status:

  • Stateless tests (arm_binary, parallel): the segmentation fault was a stack overflow in CollectSetsVisitor on 04041_defaults_long_dependency. This PR caused it by building GetSetElementParams (which now holds the large FormatSettings) inside the recursive visitor frame. Fixed in ef0bfbf: the parameters are now built out of line in getSetElementsForConstantValue(..., context).
  • AST fuzzer (amd_debug, targeted): Inconsistent KeyCondition behavior on key_nullable IN (NULL) is unrelated. It also fails on master and in other PRs, and Keep null-aware set atoms out of the nullable-key exact-count safeguard #121089 matches it.

@groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=fc3d72a385d845647adb4a81416fd41f0b141434&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%29 and provide a fix in a separate PR. If the fix is already in progress (possibly #121089), link it here.

@groeneai

groeneai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

The fix is already in progress: #121089 (mine, open, waiting for review).

The job's server.log shows the shape it fixes: the PREWHERE condition is nullIn(key_nullable, ...), so transform_null_in = 1 was in effect, over the bare Nullable(UInt32) sorting key of the 03733_has_function_key_condition table ((column 0 in 1-element set)). nullIn matches a NULL key definitely, but the nullable-key exact-count safeguard in KeyCondition::mayReadNullKeyValue treats it like plain IN and marks the NULL-only granules as possibly false, which contradicts the exact range from matchesExactContinuousRange(). #121089 exempts null-aware set atoms over a bare key from that safeguard.

The failed query with SET transform_null_in = 1, on that test's table and data, aborts on master debug (3e0adf0) with the same log line, and returns 10000 (the NULL row count) on the amd_debug build of #121089, with and without the exact-count projection.

alexey-milovidov and others added 2 commits October 5, 2026 19:32
…at settings

The old-interpreter fast path for a literal `array(...)` on the right side of `IN`
casts each element to the common supertype with `convertColumnToTypeOrThrow` before
the set is built. It used default `FormatSettings`, so with `String` as the supertype
`['yes', 'x'] IN ([true, 'x'])` was `0` under `bool_true_representation = 'yes'`,
while `CAST([true, 'x'] AS Array(String))` is `['yes', 'x']`. Pass the query's format
settings, from an out-of-line helper so that `FormatSettings` stays off the frames
of the recursive visitor.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CH Inc sync failed because of 04072_columns_cache_memory_usage in a private stateless job. This PR does not cause it: the test is a known flaky one, tracked in ClickHouse/clickhouse-private#79437, and the fix is in progress in #123949. Thanks @groeneai for confirming that #121089 covers the AST fuzzer failure. I also merged master and pushed a fix for the remaining review thread (the literal-array fast path in ActionsVisitor).

…endered to `String`

`05321_sqlite_pushdown_enum_constant` was added on master and pins the old
behaviour of a one-element tuple key `tuple(s) IN (tuple(E))`: the local set
held the `Enum` constant's value as text (`'3'`), and the filter pushed to
SQLite followed it. This PR intentionally renders a typed constant converted
to `String` with its own text serialization, so the set now holds the `Enum`
name (`'7'`), consistent with the bare `s IN (E)` case, and the pushed filter
follows it.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=latest&name_0=PR
PR: #118372

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CI status: the only failing test, 05321_sqlite_pushdown_enum_constant, was added on master and pinned the old behaviour for a one-element tuple key, tuple(s) IN (tuple(E)). There, the set held the Enum value as text ('3'). This PR changes that on purpose: the set now holds the Enum name ('7'), the same as in the bare s IN (E) case. I updated the reference and the comment in 0b77b5f and verified the test locally. The new_tests_check failure in Finish Workflow only follows from the dropped Bugfix validation jobs.

alexey-milovidov and others added 4 commits October 25, 2026 17:11
… does

`CAST(x AS Time)` of a `Date` or `Date32` gives `00:00:00`, but the `Field` conversion wrote the
day's Unix timestamp. Now that nested element hints are passed down, this reached `Array(Time)` in
the set of `IN` and in the `values` table function, where a timestamp beyond the `Time` range
(`2106-02-07`) wrapped to `-06:28:16` in the `Int32` storage and matched an unrelated row.

Address review: #118372 (comment)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ime64` as midnight

The previous commit converts a `Date` / `Date32` constant to `Time` / `Time64` as midnight, as `CAST`
does, instead of the day's Unix timestamp. So `t64 IN (toDate32('9999-12-31'))` now matches the
stored `00:00:00` (and still does not overflow). The test pinned the old behaviour; update it.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=latest&name_0=PR&name_1=Fast%20test
PR: #118372

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CI status for bfe3693: every test job passes. The only failure is Build profile diff, which failed with LogClusterNotReady: the endpoint never became ready because the CI logs cluster was unreachable, not because of this change. That is tracked in #120462 (a related fix is in progress in #126200). The branch already includes a fresh merge of master, and there are no unresolved review threads.

Comment thread src/Interpreters/convertFieldToType.cpp Resolved
alexey-milovidov and others added 3 commits October 30, 2026 05:08
…o its day

With the source element type now passed down to the elements of an `Array`,
`Tuple` or `Map`, a nested `DateTime` / `DateTime64` constant reached the
`Date` / `Date32` branches of `convertFieldToType`, which truncate the time of
day even under `strict`. So `[toDate('2020-01-01')] IN
([toDateTime('2020-01-01 12:00:00', 'UTC')])` returned 1 while the comparison
with `=` returns 0. Under `strict`, such a value is now not representable;
materialization (`CAST`, `values`) still truncates it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… destination type

A `NULL` member replaced with the default of the destination type by
`input_format_null_as_default` was then converted as a value of the source
type: a `DateTime64` default was read as a `Date` (`BAD_GET`), and a
`DateTime` default as a day number. Such a member is now used as is.
The regression is covered by `05459_set_nested_datetime_to_date_time_of_day`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=7cb89e02a314d31a580eee1e9bf903c78bc124e5&name_0=PR&name_1=Stress%20test%20%28amd_debug%29 (Hung check failed: a cancelled select makeDate(2284,1,1) stuck in system.processes for 1207 s; this PR does not touch that code) and provide a fix in a separate PR. If the fix is already in progress, link it here. The Fast test (arm_darwin) failure of 05397_clickhouse_local_locked_path_untouched is already fixed on master (59f220cb8187), and that fix was merged into this branch.

@groeneai

Copy link
Copy Markdown
Collaborator

Acknowledged. This one is not covered by my open #127913, so I'm working on a separate fix and will link the PR here.

The query is from 02242_make_date, which the Stress test ran over the web terminal (Protocol: webterminal in the run log). The client printed the result row, then Code: 241. DB::Exception: Query memory tracker: fault injected ... (MEMORY_LIMIT_EXCEEDED), and returned to the prompt; the only thread of the query is the embedded client idle in ReplxxLineReader::readOneLine.

Unlike the earlier hits of this shape, the query never reached onException: its ProfileEvents have QueryMemoryLimitExceeded: 1 but no FailedQuery, and the server log has no executeQuery error for 9ada7418-b59f-450a-8e8e-3075bc932d35 (its last line is LocalConnection: Executor timeout encountered, will retry). So the fault was thrown on the client thread outside the path that turns an error into an Exception packet, and LocalConnection kept the query state, with its system.processes entry, waiting for the session's next query. #127913 releases the state only when the Exception packet is delivered, so it does not help here.

@groeneai

Copy link
Copy Markdown
Collaborator

The fix is #128209. A fault thrown on the client thread mid-query makes ClientBase resynchronize through LocalConnection::checkConnected, which was a no-op, so the abandoned query stayed in system.processes; it now ends that query. It complements #127913, which covers the path where the server-side error is delivered as an Exception packet.

The previous commit rejected a `DateTime` / `DateTime64` with a time of day in
the `Date` / `Date32` branches of `convertFieldToType` under `strict`. Those
branches also convert a scalar constant wrapped in `Dynamic`, so
`d IN (CAST(toDateTime('2020-01-02 05:00:00') AS Dynamic))` stopped matching
while the plain `d IN (toDateTime('2020-01-02 05:00:00'))` still truncates,
which broke `05060_enum_in_variant_dynamic_in_set` and
`05137_dynamic_constant_folding_distributed` in the Fast test:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118372&sha=5d59c531384ff95629ef03268f61858b0dca5eab&name_0=PR&name_1=Fast%20test

The check now applies only to the members of an `Array`, `Tuple` or `Map`
constant, which is what the review asked for.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The Fast test failures of 05060_enum_in_variant_dynamic_in_set and 05137_dynamic_constant_folding_distributed on 5d59c53 came from this PR. The previous commit rejected a DateTime with a time of day in the scalar Date branches of convertFieldToType under strict, and those branches also convert a constant wrapped in Dynamic. So d IN (CAST(toDateTime(...) AS Dynamic)) stopped matching while the plain d IN (toDateTime(...)) still truncates. Fixed in 5e4af83: the check now applies only to the members of an Array, Tuple or Map constant. Locally, 05060, 05459 and the other tests of this PR pass, and the 05137 query gives ['2020-01-02'] again. The new_tests_check failure only followed from the Bugfix validation jobs being dropped after the Fast test failed. Thanks @groeneai for #128209, the fix for the Stress test hung check.

…ested `Dynamic` / `Variant` member of a strict set

`convertAlternative` converted the recovered `DateTime` / `DateTime64` alternative of a
`Dynamic` / `Variant` member of a composite straight to `Date`, truncating the time of day; the
outer conversion then saw the member typed as `Date` already and skipped the check. So
`[toDate('2020-01-01')] IN (CAST([toDateTime('2020-01-01 12:00:00', 'UTC')], 'Array(Dynamic)'))`
was 1 while `=` is 0. Run `isDateTimeElementWithTimeOfDay` on the recovered alternative before
converting it. A scalar `Dynamic` constant does not reach `convertAlternative` and keeps truncating.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The Upgrade check (amd_release) failure (Division by zero ... While executing TTL in clickhouse-server.log) is unrelated to this PR: it comes from the 05073 fixture TTL merge and is handled by #127731.

serprex pushed a commit to serprex/ClickHouse that referenced this pull request Nov 2, 2026
upgrade_runner.sh calls configure() twice over one embedded Keeper and data
directory, and with RANDOMIZE_KEEPER_FEATURE_FLAGS=1 each call draws
check_not_exists, create_if_not_exists and remove_recursive again,
independently. When create_if_not_exists goes from 1 to 0, a coordinated
refreshable view created during the stress phase (04811's APPEND view in a
database recreated as Replicated) is attached against a Keeper that lost the
flag, and RefreshTask stops it by design, logging an <Error> that the upgrade
log scan reports. This failed the check on 3 unrelated PRs in 30 days
(ClickHouse#118372, ClickHouse#117784, ClickHouse#114812); all 3 job logs show the 1 -> 0 flip.

A real in-place upgrade does not downgrade its Keeper, so carry the flags the
previous-release configure() drew into the upgraded server's keeper_port.xml
and fail the job if they still differ, the same shape as the codec carry-over
of ClickHouse#121249. Every job still draws random flags.

Validated locally: the real code extracted from both scripts, run 2000 times
in the CI image, restores the first draw 2000/2000 with no FAIL row; with the
restore removed the new check fails 1765/2000. On a master build, restarting
with create_if_not_exists turned off logs exactly the CI line, and restarting
with the flags unchanged logs nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	src/Interpreters/convertColumnToType.cpp
Comment thread src/Interpreters/convertFieldToType.cpp Resolved
Comment thread src/Analyzer/SetUtils.h Resolved
alexey-milovidov and others added 2 commits November 10, 2026 23:27
`IDataType::equals` ignores custom names, so with the source element type
now passed down as a hint, a `UInt8` member reached the identity shortcut of
`convertFieldToType` for a `Bool` target and stored the raw byte (e.g. 2)
instead of `true`. Require the full type names to match too, as the
identity check of `convertColumnToType` and `CAST` do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…default probe

`isDefaultValueInConstantSet` built its probe set with default format
settings, so under e.g. `bool_true_representation = 'yes'` it disagreed
with the set of `IN` itself and `optimize_inverse_dictionary_lookup`
chose a wrong rewrite for missing dictionary keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov and others added 2 commits November 18, 2026 02:28
…w-aware helper

Master added `resolveActiveAlternative(const ConstantValue &)` built on `resolveActiveAlternativeType`,
which this PR replaced with `resolveActiveAlternative(const IColumn &, const DataTypePtr &, size_t)`.
Use the new helper's `type` for row 0 of the constant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed-constant-117240

Conflicts in `src/Analyzer/SetUtils.cpp` and `src/Planner/CollectSets.cpp`: master added
`tryGetSetElementsForTupleOfPlainValues` and its call in `CollectSetsVisitor`, next to the
out-of-line `getSetElementsForConstantValue(..., context)` overload of this branch. Both are kept.
`tryGetSetElementsForTupleOfPlainValues` now takes `transform_null_in` alone instead of
`GetSetElementParams`, because that struct holds the large `FormatSettings` in this branch and
must not be built in the frame of the deeply recursive `CollectSetsVisitor` (stack overflow in
`04041_defaults_long_dependency`).

Co-Authored-By: Claude Fable 5.2 <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

2 participants