Skip to content

Fix prettyPrintJSON, printf, formatQuery and other functions throwing on LowCardinality and Nullable arguments - #122356

Merged
PedroTadim merged 10 commits into
ClickHouse:masterfrom
groeneai:fix-functions-throwing-on-default-argument-value
Nov 18, 2026
Merged

PedroTadim merged 10 commits into
ClickHouse:masterfrom
groeneai:fix-functions-throwing-on-default-argument-value

Conversation

@groeneai

@groeneai groeneai commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #122277
Closes: #121498
Closes: #132563
Related: #117359

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 into CHANGELOG.md):

Fixed prettyPrintJSON, printf, formatQuery, formatQuerySingleLine, parseQueryToJSON, formatQueryFromJSON, conv, MGRSToGeo, ULIDStringToDateTime, readWKTPoint, readWKBPoint, filesystemAvailable/Capacity/Unreserved, base32Decode, base58Decode, base64Decode, base64URLDecode, the AES encrypt/decrypt functions, divideDecimal, clamp, widthBucket, regexpPosition, the tuple functions, hop, hopStart, hopEnd, timeSeriesIdToGroup, s2ToGeo, s2CapUnion, s2RectAdd, s2RectUnion, s2RectIntersection throwing an exception on a valid LowCardinality argument, or on a Nullable argument holding a NULL, because they were executed on the argument type's default value, which no row held. The tuple and vector functions (e.g. dotProduct), clamp, s2ToGeo, filesystem* and multiplyDecimal also no longer throw on a row removed by ARRAY JOIN. Closes #122277. Closes #121498. Closes #132563.

Description

On 26.8.2.7 LTS and master, valid input is rejected:

SELECT prettyPrintJSON(materialize(toLowCardinality('{"a":1}')));  -- Code: 36 ... The document is empty
SELECT printf(x, 1) FROM (SELECT arrayJoin(['%d', NULL]) AS x);    -- Code: 42 ... but format is

A function accepting canBeExecutedOnDefaultArguments is executed over the LowCardinality dictionary, which always holds the type's default value, and over the values behind NULLs. #117359 made the functions that throw on that value decline it; these were missed and now decline it too. A row that holds an invalid value still throws.

With lazy column replication (the default), rows removed by ARRAY JOIN stay in ColumnReplicated arguments, compacted away only if canThrow is true; the functions in the entry's second sentence reported false and now declare canThrowIfKnown.

The contract is per function: only the function knows if its argument's default value is in its domain. The tuple functions declare both traits once, in ITupleFunction. I found them by running every regular function and documented example on LowCardinality and arrayJoin([x, NULL]) arguments.

Not covered, your call: results that cannot be Nullable (Array, Map, Variant, e.g. h3kRing) still run f(default) for NULL rows, by the documented convention.

Validation: every positive statement of the new test fails on master and passes with the fix; the negative controls throw on both.


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

Version info

  • Merged into: 26.11.1.2791-master (included in 26.11 and later)

groeneai and others added 3 commits September 25, 2026 22:47
…lable arguments

A function that accepts canBeExecutedOnDefaultArguments() is executed over
the whole LowCardinality dictionary, which always stores the type's default
value at index 0 even when no row references it, and over the nested values
behind NULLs, which hold the type's default for columns read from a table.
A function that throws on that default value therefore rejects valid data:

    SELECT prettyPrintJSON(materialize(toLowCardinality('{"a":1}')));
    -- Code: 36. Invalid JSON string ...: The document is empty
    SELECT printf(x, 1) FROM (SELECT arrayJoin(['%d', NULL]) AS x);
    -- Code: 42. Number of arguments for function printf doesn't match

ClickHouse#117359 made such functions decline the contract; these were missed:
prettyPrintJSON, printf, formatQuery, formatQuerySingleLine,
parseQueryToJSON, formatQueryFromJSON (ClickHouse#122277, ClickHouse#121498), and, found by
sweeping all regular functions, conv, toBool, MGRSToGeo, readWKTPoint,
readWKBPoint, filesystemAvailable/Capacity/Unreserved, the throwing
base32/base58/base64/base64URL decoders, encrypt/decrypt and the MySQL and
try variants, divideDecimal, clamp, widthBucket, regexpPosition, the tuple
division functions, hop/hopStart/hopEnd, s2ToGeo, s2CapUnion, s2RectAdd,
s2RectUnion and s2RectIntersection.

Each now declines the contract, so the framework evaluates only the values
the rows hold (the minimal dictionary, NULL rows filtered first). Where one
class serves both a throwing and a non-throwing name (formatQuery...OrNull,
try*Decode and the encoders, multiplyDecimal, tuple plus/minus/multiply/
intDivOrZero, tumble*), only the throwing ones decline, keeping the fast
path for the rest. An empty IV is valid as "no IV" in the non-AEAD AES
modes, so the AES comment names only the key.

The test runs every function over a LowCardinality column and over a
Nullable column holding a NULL, and keeps rows that really hold an invalid
value as negative controls. It clamps
short_circuit_function_evaluation_for_nulls_threshold to at least 1: at a
threshold of 0.5 or less the 50% NULL inputs are short-circuited and the
Nullable cases would pass without the fix.

Closes ClickHouse#122277
Closes ClickHouse#121498

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

Two more functions that the sweep recorded throw on the value behind a NULL
row of a Nullable argument:

    SELECT ULIDStringToDateTime(x, 'UTC')
    FROM (SELECT arrayJoin(['01GNB2S2FGN2P93QPXDNB4EN2R', NULL]) AS x);
    -- Code: 44. ... ULID must be 26 characters long
    SELECT timeSeriesIdToGroup(timeSeriesStoreTags(x, [('region', 'eu')], '__name__', 'up'))
    FROM (SELECT arrayJoin([toUInt64(8374283493092), NULL]) AS x);
    -- Code: 36. Unknown identifier 0

ULIDStringToDateTime rejects the empty string behind the NULL (and the zero
bytes behind a NULL FixedString(26)). timeSeriesIdToGroup has a UInt64
result, so the numeric fast path ran it on the 0 behind the NULL, and
timeSeriesStoreTags() skips rows with a NULL identifier, so the collector
does not know that 0. Both now decline canBeExecutedOnDefaultArguments(),
so NULL rows are filtered out before execution. Their LowCardinality arms
were not affected: a DateTime64 result cannot be LowCardinality, and
timeSeriesIdToGroup resolves dictionary-encoded identifiers itself.

The BaseXXDecode comment also names the second reason the throwing decoders
decline: base58Decode(x, size) rejects an empty string.

The test is renamed to 05258, as master took 05257.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Write function names in the new comments as inline code without
parentheses: `timeSeriesStoreTags`, `intDiv`, `modulo`, `positiveModulo`
and `divide`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 2 findings over 2 rounds) and my own cold review (3 findings).

# Sev Finding Verdict Evidence / action
1 ⚠️ ULIDStringToDateTime and timeSeriesIdToGroup threw on a Nullable argument holding a NULL, same mechanism, not covered AGREE, fixed @ fa2d363 override added, one test statement each, red on master and green with the fix
2 ⚠️ timeSeriesIdToGroup still rejects a LowCardinality(Nullable(T)) identifier DISAGREE rejected at analysis by the id type check, on master and with this PR: identifiers are "any comparable non-Nullable type" (TimeSeriesTagsFunctionHelpers.h:65-68) and the function disables the LowCardinality adaptor (timeSeriesIdToGroup.cpp:46); this PR acts only at execution (IFunction.cpp:367, :584)
3 💡 the BaseXXDecode comment named only the FixedString reason AGREE, fixed @ fa2d363 comment also names an empty string with an expected size
4 💡 test prefix 05257 already taken on master AGREE, fixed @ fa2d363 renumbered to 05258
5 💡 the new timeSeriesIdToGroup comment writes timeSeriesStoreTags() instead of timeSeriesStoreTags AGREE, fixed @ 8f85022 comment reworded before publication

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20260926-000600

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes: SELECT prettyPrintJSON(materialize(toLowCardinality('{"a":1}'))) and SELECT printf(x, 1) FROM (SELECT arrayJoin(['%d', NULL]) AS x) throw on master and on 26.8.2.7 LTS, every time.
b Root cause explained? A function accepting canBeExecutedOnDefaultArguments runs over the whole LowCardinality dictionary (which always holds the type default) and over the values behind NULLs; these functions throw on the default value.
c Fix matches root cause? Yes: each function declines the contract, so only referenced values are evaluated; rows that really hold an invalid value still throw. No guard, no framework change.
d Test intent preserved / new tests added? New test 05258_functions_throwing_on_default_argument_value; a Random settings limits clamp keeps its Nullable arms from passing without the fix (validated with a negative control).
e Both directions demonstrated? Each positive statement run separately: fails on the base binary, passes on the fix binary, output equal to the plain-type result; runner [ FAIL ] on base, [ OK ] on fix; 50/50 randomized.
f Fix is general across code paths? Carriers found by sweeping all regular functions; classes serving throwing and non-throwing names decline only for the throwing ones.
g Fix generalizes across inputs (params/datatypes/wrappers)? LowCardinality, Nullable, LowCardinality(Nullable), empty and multi-row columns, FixedString, every argument position and alias measured on base and fix.
h Backward compatible? (maintainer-approved exception only) Yes: no setting or format change; results change only from an exception to the correct answer.
i Invariants and contracts preserved? The override is a pure trait; the minimal-dictionary and NULL-filtering paths are existing ones, and the no-NULL fast path is unchanged.

Session id: cron:clickhouse-impl-slot-40:20260925-234200

@clickhouse-gh

clickhouse-gh Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9a9d605]

Summary: ✅


AI Review

Summary

Reviewed #122356 at 9a9d605ef9ebfdc1b799d0492ba29dd30c6d8204. The changes prevent the affected functions from evaluating unused LowCardinality dictionary entries, values behind NULLs, and discarded ColumnReplicated rows. No outstanding actionable findings: both earlier blocker threads are addressed in the current code and covered by 05258_functions_throwing_on_default_argument_value. That test passed in the preceding revision's stateless job, and both functional bugfix validation jobs passed there.

Missing context / blind spots
  • ⚠️ The current head's CI workflow is still running; stateless and functional bugfix validation results remain pending. Completed results on this head would close that validation gap. No local build or test execution was performed.
Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Sep 26, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... label Sep 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8f85022

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Performance Comparison (arm_release, master_head, 3/6) / generate_random_json #1 the shard's own report and the dashboard both call it slower: 0.974 s -> 2.204 s (+2.26x). The query is sum(NOT ignore(*)) over generateRandom('x JSON(max_dynamic_paths = 4)', 0, 10, 10), so it never executes any of the functions this PR changes. On arm this query is bimodal for both binaries: about 2% of runs take about 2.2 s instead of 0.92 s, and the reference binary draws the slow mode too (11 reference vs 19 tested runs out of 780). The same red hit 13 other PRs and 2 master runs since the test was added on 2026-09-23, while amd had 0 of 285 a fix task is created (investigating at full effort, fixing-PR link to follow here)
Mergeable Check, PR rollups, red only because of the row above a fix task is created (the same one as for the row above)

All 173 check runs completed (133 pass, 39 not selected, 1 red), Finish Workflow is green and
CH Inc sync passed. CIDB has no FAIL or ERROR test row on this head. The shard's 9 too long
and 3 unstable are informational: they never fail a shard on their own.

Session id: cron:our-pr-ci-monitor:20260926-090306

@groeneai

Copy link
Copy Markdown
Collaborator Author

Fixing PR for the Performance Comparison (arm_release) generate_random_json #1 red: #122464.

…ing-on-default-argument-value

# Conflicts:
#	src/Functions/printf.cpp
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 6c6893d

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build (arm_tidy, 3/4) / Build ClickHouse master build break since af19343b2516, not from this PR (it does not touch the file): unit_tests_dbms does not compile, gtest_functions_stress.cpp:2367: error: value of type 'const ResolvedAddress' is not contextually convertible to 'bool'; no diagnostic in the files of this PR #126269 (external, open)
Finish Workflow / new_tests_check.py both functional Bugfix validation jobs were dropped because of the build failure above #126269 (the owner of the first row)
CH Inc sync - CH Inc sync (private, not actionable by me)
Mergeable Check, PR praktika rollups of the rows above #126269 (the owner of the first row)

The build failure dropped 166 dependent jobs, so no functional test has run on this head yet.

Session id: cron:our-pr-ci-monitor:20261016-130004

groeneai and others added 2 commits November 9, 2026 13:27
…ing-on-default-argument-value

# Conflicts:
#	src/Functions/toBool.cpp
Master fixed `toBool` on a `LowCardinality` argument in ClickHouse#80263, so that
statement no longer fails without this PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 9a9d605ef with master 82024f195 (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

73 object files changed (+69.61 KiB total), 0 added.

Object file Master PR Δ
src/Functions/CMakeFiles/clickhouse_functions_obj.dir/vectorFunctions.cpp.o 3.89 MiB 3.91 MiB +20.25 KiB (+0.51%)

711 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

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

Job report

# Conflicts:
#	src/Functions/FunctionBaseXXConversion.h
#	src/Functions/FunctionsAES.h
#	src/Functions/FunctionsDecimalArithmetics.h
#	src/Functions/FunctionsTimeWindow.cpp
#	src/Functions/TimeSeries/timeSeriesIdToGroup.cpp
#	src/Functions/ULIDStringToDateTime.cpp
#	src/Functions/clamp.cpp
#	src/Functions/conv.cpp
#	src/Functions/filesystem.cpp
#	src/Functions/formatQuery.cpp
#	src/Functions/formatQueryFromJSON.cpp
#	src/Functions/mgrsToGeo.cpp
#	src/Functions/parseQueryToJSON.cpp
#	src/Functions/prettyPrintJSON.cpp
#	src/Functions/printf.cpp
#	src/Functions/regexpPosition.cpp
#	src/Functions/s2CapUnion.cpp
#	src/Functions/s2RectAdd.cpp
#	src/Functions/s2RectIntersection.cpp
#	src/Functions/s2RectUnion.cpp
#	src/Functions/s2ToGeo.cpp
#	src/Functions/vectorFunctions.cpp
#	src/Functions/widthBucket.cpp
Comment thread src/Functions/vectorFunctions.cpp Resolved
`IExecutableFunction::execute` compacts `ColumnReplicated` arguments only
when `canThrow` is true, and for a function that does not override
`canThrowIfKnown` that falls back to
`isSuitableForShortCircuitArgumentsExecution`. The tuple division and
modulo operators (also the `ByNumber` variants), `clamp`, `s2ToGeo`,
`filesystemAvailable`/`Capacity`/`Unreserved` and `multiplyDecimal`
answer `false` there although they throw on data, so they were evaluated
on the values of rows that `ARRAY JOIN` removed, e.g. with default
settings:

    SELECT tupleIntDiv((15, 10), d)
    FROM values('d Tuple(UInt64, UInt64), arr Array(UInt8)',
        ((0, 0), []), ((3, 2), [1, 2, 3]))
    ARRAY JOIN arr  -- Code: 153 ... Division by zero

Declare `canThrowIfKnown` for them, as `runningAccumulate` and `repeat`
already do. Other consumers of `canThrow` already treated these
functions as throwing (`canThrowIfKnown().value_or(true)`), so only the
compaction decision changes.

Reported by the AI review on ClickHouse#122356.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Functions/vectorFunctions.cpp Resolved
The tuple functions apply scalar functions to the elements, and those
throw for some element types and values: a zero divisor, a decimal
overflow, a string that is not a date. Naming the throwing operations
per template was not enough (`tuplePlus` adds an interval to a String
element, `tupleMultiply` overflows on decimals), and `dotProduct`, the
norms and distances, and the `+`/`-` operators on tuples bypass the
templates altogether:

    SELECT tuplePlus(t, tuple(toIntervalDay(1)))
    FROM (SELECT arrayJoin([tuple('2026-01-02 00:00:00'), NULL]) AS t)
    -- Code: 41 ... Cannot read DateTime

    SELECT dotProduct(t, t) FROM (SELECT t FROM values(
        't Tuple(Decimal(18, 0), Decimal(18, 0)), arr Array(UInt8)',
        ((100000000000000000, 100000000000000000), []), ((2, 2), [1, 2]))
        ARRAY JOIN arr LIMIT 10)
    -- Code: 407 ... Decimal math overflow

So `ITupleFunction` and the `TupleOrArrayFunction` dispatcher (which
calls the tuple and array implementations directly) decline execution
on default arguments and report that they can throw, and binary
arithmetic declines default arguments when it delegates to a tuple
function. The per-template `throws_on_zero_divisor` is gone.
`canThrowIfKnown` only changes the `ColumnReplicated` compaction
decision: the other consumers already read a missing answer as `true`.

The `ARRAY JOIN` example in the previous commit's message is evaluated
before `ARRAY JOIN` with the default `query_plan_lift_up_array_join`,
like any scalar expression, so it throws either way; a subquery with
`LIMIT`, as above, reaches the lazy path with default settings.

Reported by the AI review on ClickHouse#122356.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
clickhouse-gh[bot]
clickhouse-gh Bot previously approved these changes Nov 18, 2026
@clickhouse-gh
clickhouse-gh Bot dismissed their stale review November 18, 2026 15:40

AI review of a later commit does not approve the PR, see the AI Review comment.

# Conflicts:
#	src/Functions/FunctionsAES.h
@PedroTadim
PedroTadim enabled auto-merge November 18, 2026 19:56
@PedroTadim
PedroTadim added this pull request to the merge queue Nov 18, 2026
Merged via the queue into ClickHouse:master with commit 19052c2 Nov 18, 2026
193 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 18, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Nov 19, 2026
`FunctionConv` inherited `canBeExecutedOnDefaultArguments = true`, so the default implementation for
`Nullable` arguments passed the nested values of NULL rows to `executeImpl`. Since a non-finite float now
throws, `conv(nullIf(x, inf), 10, 10)` and `conv(if(isNaN(x), NULL, x), 10, 10)` failed with
`BAD_ARGUMENTS` instead of returning NULL for those rows, as did a non-finite number on a row with a NULL
base. Rows with a NULL argument are now skipped before execution. Non-NULL `nan` and `inf` still throw.

The override is byte-identical to the one ClickHouse#122356 added on master, so the two merge cleanly.

PR: ClickHouse#132662

Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbinMadathil07 added a commit to AbinMadathil07/ClickHouse that referenced this pull request Nov 20, 2026
* Keep the dictionary and bloom filter cases of five more Parquet tests live

These tests compare values only, so they kept passing when a random
setting removed the encoding or the index their case is about:

- 05406: a random `output_format_parquet_max_dictionary_size` of 0, 1
  or 1024 writes the dictionary round trip without a dictionary, and
  `output_format_parquet_use_alp_encoding = 1` writes float columns
  without one at any size, so the case that the dictionary keeps zero,
  negative zero and NaNs with different payloads apart tested nothing.
  Bound the dictionary size to at least 1 MiB and pin ALP off.
- 04646: the two cases of the exact dictionary filter need a
  dictionary page and the dictionary pruning pass, which a high
  watermark of 1 byte or 1 MiB skips. Bound both, as in 05055.
- 02735: 1M distinct values must grow the dictionary past its 1 MiB
  limit. With 0 no dictionary is tried, and with 1 or 1024 the writer
  drops it within the first two batches, so bound it to at least 1 MiB.
- 04097: the bloom filter prefetch regression needs a bloom filter
  written with the default bits per value and read with push-down.
- 04545: it also covers the page index path, which needs a page index.

The other Parquet tests either set these settings on their writes and
reads, assert the encodings, the bloom filters or the pruning, or do
not depend on them.

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

* Address review: release only own bucket locks, detect empty batches independently of commit limits

With `parallel_inserts` each streaming task has its own processor and commits independently,
but `FileIterator::releaseFinishedBuckets` released the finished bucket holders of all processors.
A holder is finished when its source reaches the end, before the insert of that source completes,
so a commit of one task could release the bucket lock of another task whose insert was still running,
letting another replica take the bucket and process later files before the first insert failed.
Now `releaseFinishedBuckets` takes the processors of the batch which has just been committed.

`ProcessingProgress::processed_files` is counted only when `max_processed_files_before_commit` is set,
so with that limit disabled and a row or byte limit enabled, a batch which processed files looked empty:
the consumption cycle ended after every batch and the backlog was drained one batch per poll.
Now a separate `acquired_files` counter, maintained regardless of the commit limits, is used to detect
empty batches, to guard the reset of the batch size override, and as the size of a failed batch.

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

* Document the musl Rust target in the build guide

The default Linux x86_64 and aarch64 build links against musl now, and
`contrib/corrosion-cmake` selects the matching `*-unknown-linux-musl`
Rust target. `rustup` installs only the `*-unknown-linux-gnu` target, so
following the guide made `cmake` fail with
`Target x86_64-unknown-linux-musl is not installed for toolchain`.

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

* GPU aggregation: remove `GPUAggregatingStep`, one `canAggregateOnDevice`, fixes of the AI review

- No `GPUAggregatingStep` in `src/Processors/QueryPlan` in this pull request.
- `canAggregateOnDevice` replaces `canReduceOnDevice`, `canGroupByOnDevice`, `canGroupByReduceOnDevice` and their `OrThrow` variants.
- `streaming_groupby` is closed into parts before a group could count past a `cudf::size_type`.
- No `avg` of `Float32`, which cuDF sums in `Float32`; no `min` or `max` of floats, as cuDF does not skip a `NaN` like ClickHouse.
- Exceptions of cuDF, rmm and libstdc++ are never destroyed (`keepCurrentException`): their base destructors bind to those of libc++.
- `ColumnUploadPipe::takeDeviceColumn` makes the next buffer in place, as the buffers have no assignment.

Related: ClickHouse#132443

* GPU aggregation: no gtest in this pull request

Related: ClickHouse#132443

* Bump `musl` to fix `AI_ADDRCONFIG` lookups on loopback-only hosts

Fork commits `f255b5c8` and `ff1ab367` gave `getaddrinfo` glibc's
`AI_ADDRCONFIG` semantics. On a host with no non-loopback address, they
dropped both address families and returned `EAI_NODATA` for every name.
`DNSResolver` always passes `AI_ADDRCONFIG`, so `clickhouse-client`
could not resolve `localhost` under `docker run --network none`,
`unshare -n` or systemd `PrivateNetwork=yes`. As in glibc, an
`AF_UNSPEC` lookup is now not narrowed when neither family is
configured.

The bump also brings in ClickHouse/musl#20 (symbol sizes for asm
functions).

ClickHouse/musl#21

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

* Fix the `contrib/llvm-project` pin to the real tip of `ClickHouse/release-23.x`

The merge of master pinned `55541575edec5a8d4bb94faf4a66e30d8b4e7a66`, which
does not exist: only the 12-character prefix matches the real merge commit of
ClickHouse/llvm-project#161. `Config Workflow` failed
to fetch it:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=132795&sha=b50187317c6de5b87b22060d147f749bc4b35535&name_0=PR&name_1=Config%20Workflow

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

* Docs: list adbcBridge under Go, Rust, Java and C# in the third-party client libraries

* GPU aggregation: far fewer comments, one `catch` in `guarded`, no slices in `streaming_groupby`

- `guarded` catches once and keeps the exception of the device libraries from being destroyed in one line; the messages are read by `messageOfDeviceException`.
- `StreamingPartials` takes a batch as it is, and closes before `streaming_groupby` could count past a `cudf::size_type`.

Related: ClickHouse#132443

* Look up the `geoDistance` tables once per block

`distance` is called for every row, and since the tables are built on first use, every access to them went through the initialization guard of the local static in `impl`. `run` now takes the reference once and passes it to `distance`.

Address review: ClickHouse#126791 (comment) (thread on `src/Functions/greatCircleDistance.cpp`)

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

* Docs: describe the Protobuf framing ClickPipes expects with AWS Glue

* Use `VectorWithMemoryTracking` for the lazy Arrow type table

The style check that came with the merge of `master` forbids plain `std::vector` in `src/Processors/Formats`.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=46136c021aceb2c4ed4368a0a1a9f3ba214be6a8&name_0=PR&name_1=Style%20check
PR: ClickHouse#126791

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

* Mark the `geoDistance` table lookups `[[nodiscard]]`

`clang-tidy` asks for it (`modernize-use-nodiscard`) since they became `const` members.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=384918398089744c9929f936ac283fbf88622246&name_0=PR&name_1=Build%20%28arm_tidy%2C%202%2F4%29
PR: ClickHouse#126791

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

* Let gdb pass the `system.stack_trace` signal of the musl server in fuzzer jobs

The gdb script took the number of `SIGRTMIN` from the shell of the fuzzer
image, which is linked with glibc: 34. The server is a static musl binary since
ClickHouse#109239, and its `SIGRTMIN` is 35,
so gdb stopped the server on the first read of `system.stack_trace`, dumped
all threads and detached. Handle both numbers.

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

* Pin 05829 to query-based parallel replicas

`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`
sets `parallel_replicas_plan_based = 1` in the server profile. The test pins every
other parallel-replicas setting, so in that job only its implementation changes:
plan-based parallel replicas cannot match the shipped plan to the single-node plan
(`Cannot find step with matching hash ... in single-node plan`; the local plan has
one `Expression` under `Aggregating` where the single-node plan has two), so the
first run collects no statistics and the second never switches to the plan with
parallel replicas: `05829_apply 0` in every master run of the job.

Pin query-based parallel replicas, as 91d6019 did for 05175 (same class,
ClickHouse#131450), so the test keeps
checking the set transplant of ClickHouse#132659 in that job too.

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

* Update PGO+BOLT toolchain to 51fdb0b

* Adapt new code from `master` to the removed `CPUFlagsCache` and the `STACK_TRACE_SERVICE_SIGNAL` macro

`gtest_memchr_strlen_page_boundary.cpp` used `CPUFlagsCache`, which this branch removed; it calls the `have*` functions instead, which is all `CPUFlagsCache` did (once, in a static initializer).

`clickhouse_fuzzer.cpp` qualified `STACK_TRACE_SERVICE_SIGNAL` with `DB::`, which does not work now that it is a macro.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=126791&sha=876eaabafb0dc84ddaae5134998fb9d140634297&name_0=PR&name_1=Build%20%28amd_debug%29
PR: ClickHouse#126791

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

* Run the EXPLAIN checks of 05137_join_fixed_string_zero_bytes_runtime_filter without parallel replicas

Under plan-based parallel replicas, ReadFromParallelReplicasStep sets its
step description to a multi-line dump of the shipped plan fragment
(header and description, no actions), truncated at
query_plan_max_step_description_length = 500, and EXPLAIN prints every
line of it as a row. The fragment contains the build side's
BuildRuntimeFilter step. With enable_parallel_blocks_marshalling = 1 the
fragment's top BlocksMarshalling step pushes that line past the cut; with
0, which the runner draws in about 5% of runs, it fits, and the test's
LIKE filter matches one row more than the reference.

The EXPLAIN checks assert the single-node plan shape, so run only them
with enable_parallel_replicas = 0 in their own SETTINGS, as ClickHouse#128527 does.
The result queries keep whatever the job sets.

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

* Pin the Top-K limit in 05100_autopr_gate_lazy_read

`clickhouse-test` randomizes `query_plan_max_limit_for_top_k_optimization`
over [0, 1, 10, 100, 1000, 100000]. At 0 (no limit) or 100000, Top-K takes
the test's `ORDER BY ord LIMIT 10000` and adds `__topKFilter(ord)` to the
read's PREWHERE. Plan-based parallel replicas keeps such a read local
(`mergeTreeReadCanBeShipped`), so automatic parallel replicas finds no read
on the other replicas, skips the query and collects no statistics, and the
`05100_lazy_large_scan` row turns from 1 to 0 in
`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`.

Pin the limit to its default, as 801dfec did for 05055. The product
limitation is ClickHouse#131858.

Locally, with `parallel_replicas_plan_based=1` and the limit at 0 or 100000:
5/5 FAIL before, 5/5 OK after, 5/5 FAIL again with only the new `SET`
removed. Fully randomized plan-based runs: 6/50 FAIL before, 50/50 OK after.

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

* Pin 05628 and 05043 to query-based parallel replicas

Both tests failed in `Stateless tests (arm_binary, ParallelReplicas, plan-based,
s3 storage, parallel)`, the job ClickHouse#128413 added, whenever the randomizer drew
`query_plan_merge_filters = 0` (05628) or `query_plan_remove_unused_columns = 0`
(05043), each about 5% of runs. With `parallel_replicas_plan_based = 1`,
automatic parallel replicas then cannot match the probe plan to the single-node
plan (`Cannot find step with matching hash ... in single-node plan`,
`AutoParallelReplicasPlansNotComparable = 1`) and returns before the cost model
and before collecting statistics, so 05628's "declined after the cost model"
check and 05043's "still a candidate" check read 0. That is the open
plan-based gap ClickHouse#131450.

The tests are about query-based automatic parallel replicas, so pin that
implementation, the same way 91d6019 pinned 05175 for ClickHouse#131450. The pin is
a no-op in every job where plan-based parallel replicas is already off.

Related: ClickHouse#131450

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

* Retry a failed notary submission request and wait longer in Sign macOS binary

`notarize` ran `rcodesign notary-submit --wait --max-wait-seconds 1800` once.
rcodesign does not retry the create-submission POST, so one Apple gateway 502
on it failed the job, and its wait gave up at 1800 s although the job has a
3600 s timeout and the other steps take at most 39 s. Both leave the release
commit without a signed `clickhouse-macos.zip` until the job is re-run by hand.

Retry the command up to 5 times, but only when stderr carries the
`POST https://appstoreconnect.apple.com/notary/v2/submissions` line. rcodesign
prints it only in the error of a failed create-submission request (the request
log line is debug-level), i.e. before the upload and before any wait, so a retry
costs about 30 s at most and never starts a second wait. A failed poll, a failed
upload, the wait limit and an Invalid verdict print no such line and stay
single-attempt. Matching on the 5xx text instead would also catch a 5xx on a
poll late in the wait and resubmit, which does not fit the job timeout.

Raise the wait limit to 3000 s: 39 s of earlier steps + 30 s of retries + 3000 s
+ upload and one poll is about 3115 s, under the 3600 s timeout, so the
`finally` that removes the notary key from the reused workspace still runs.

Failures:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=8f7ca0110849149ecd80a33dc2691ad0e0bb36c1&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=c2ea85cb077899bcc31505a53bb11b9dc34e803d&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=26.10&sha=53e154ba93c524095e4cfb9957fa35e206086684&name_0=ReleaseBranchCI&name_1=Sign%20macOS%20binary%20%28amd_darwin%29

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

* Docs: sync Cloud API reference from the OpenAPI spec

* Docs: regenerate reference documentation from source

* Fix the number of read streams in test `05830_distributed_plan_squashing_before_exchange`

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

* Return NULL from `conv` for a non-finite float masked by NULL

`FunctionConv` inherited `canBeExecutedOnDefaultArguments = true`, so the default implementation for
`Nullable` arguments passed the nested values of NULL rows to `executeImpl`. Since a non-finite float now
throws, `conv(nullIf(x, inf), 10, 10)` and `conv(if(isNaN(x), NULL, x), 10, 10)` failed with
`BAD_ARGUMENTS` instead of returning NULL for those rows, as did a non-finite number on a row with a NULL
base. Rows with a NULL argument are now skipped before execution. Non-NULL `nan` and `inf` still throw.

The override is byte-identical to the one ClickHouse#122356 added on master, so the two merge cleanly.

PR: ClickHouse#132662

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

* Fix the HTTP interface link in the `Protobuf` format documentation

ClickHouse#122644 moved the HTTP interface page from `/concepts/features/interfaces/http`
to `/concepts/features/connect-to-clickhouse/protocols/http` and updated the
`#insert-protobuf` link in the generated `docs/reference/formats/Protobuf/Protobuf.mdx`,
but not in its source, the `Protobuf` format documentation here. The nightly
docs regeneration (ClickHouse#132899) therefore restores the old path, and the offline
link check (`lychee_check.py --mode links`) cannot resolve the fragment through
the redirect, because the redirect's destination is a directory `index.mdx`:

    [./reference/formats/Protobuf/Protobuf.mdx]:
    [ERROR] concepts/features/interfaces/http#insert-protobuf (at 347:27) | Cannot find fragment

Make the same change in the source, as ClickHouse#122644 did for the Prometheus links in
`StorageTimeSeries.cpp`. The regenerated `Protobuf.mdx` is then identical to the
one on master. Validated by regenerating the docs with `autogenerate_docs.py
--write` from a master binary with and without the change and running the
link check: 1 error (the one above) without, 0 with.

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

* GPU aggregation: the `avg` of unsigned integers divides a `UInt64` sum; `absorbPart` keeps the originals until the copies are done on an exception too

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy.cu` rewritten to be readable

The same algorithm: `Partials`, `PartitionedPartials`, `StreamingPartials`, `GroupBy` with a `Strategy` chosen by the first
batch, the filter in `applyFilter`. No checks that `viewOf` and the lane already make, no branch for keys with nulls of an
undecided batch, which are compacted.

Related: ClickHouse#132443

* GPU aggregation: `waitFor` in `GPUTypes.cuh`, next to `checkCuda`, as it is not of `CudfGroupBy`

Related: ClickHouse#132443

* GPU aggregation: every entry point of `CudfGroupBy` and `CudfReduction` is `guarded`

What rmm, cuDF and libstdc++ throw outside of the calls to cuDF, as the growth of a buffer or a copy of a column, does not leave
the island either: an exception of libstdc++ is not safe to format by ClickHouse.

Related: ClickHouse#132443

* GPU aggregation: `CudfGroupBy` is a class, not an interface of one implementation; masks are `DeviceBitmask`

- `CudfGroupBy` holds a `cudf_group_by::GroupBy` as `CudfReduction` holds its state, and its methods are `guarded` calls of it;
  no `createCudfGroupBy`, no `dynamic_cast` in `absorbPart`.
- The masks of the rows a filter keeps are a `DeviceBitmask` of their words and rows, not a pointer.

Related: ClickHouse#132443

* Inline the liveness check of window aggregate states

`checkCreated` was not inlined, so every row paid for a call with a full frame. Inline the test and keep only the throw out of line.

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

* Docs: update Cloud API rate limits and describe 429 responses

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

* GPU aggregation: the stream of a `HAVING` is drained on an exception too, as the caller holds its kernel only for the call

Related: ClickHouse#132443

* Remove the files left behind by `02366_cancel_write_into_file`

The test inserts into 20 files in `user_files` and kills the inserts, but
never removes the files. The targeted check of this PR repeats the test 33
times with a new database each time: its killed inserts wrote 58 GiB of files
that stayed on disk, and the runner ran out of space (`errno: 28`), failing
unrelated tests.

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

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

* Randomise adaptive compression in stateless/stress tests

* AI review: require an exact verdict line and parse it leniently

The review prompt now asks for an exact `Status: <verdict>` line. `_review_approves` falls back to the whole `Final Verdict` section when that line is missing, so a bare `✅ Approve` no longer dismisses the approval.

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

* Pin two UNIQUE KEY tests to query-based parallel replicas

With `parallel_replicas_plan_based = 1`, a read of a `UNIQUE KEY` table is
shipped and `ReadFromMergeTree::serialize` throws `SUPPORT_IS_DISABLED`
(ClickHouse#128534). `04161_unique_key_insert_duplicate` and
`05493_unique_key_disk_without_append` read such a table only through
`count()`, so in the plan-based job they fail only when the runner draws
`optimize_trivial_count_query = 0` (5% of runs) and pass otherwise.

The plan-based blacklist is checked strictly (the job does not run with
`--autopr`), so listing them would report `NOT_FAILED` on most runs, as it
did for 04161 on ClickHouse#128413. Pin them to query-based parallel replicas
instead, the way 91d6019 did for 05175. ClickHouse#128534 stays open for
plan-based support of `UNIQUE KEY` reads.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=6ade2c8d6b94ea04a0c7b0259825529aceac0fd8&name_0=MasterCI&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29

Related: ClickHouse#128534

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

* Drop unneeded no-parallel tags from seven stateless tests

* Update version_date.tsv and changelogs after v26.10.7.24-stable

* Disable Keeper fault injection in `05770_streaming_queries_replicated_cursors`

An injected Keeper fault after a block number is allocated makes the insert
retry with a new block number, so the block numbers and the cursors in the
test become nondeterministic.

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

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

* Disable adaptive codecs where they're not needed

* Docs: restore `Language clients` navigation

Remove the duplicate `integrations/language-clients/index` entry from the Concepts navigation. Mintlify then selects the dedicated `Language clients` navigation for the page.

Related: ClickHouse#124471

* Pack tuples of fixed-size values into the keys of the radix partitioned `uniqExact`

A tuple whose elements have a fixed size of 1, 2, 4, 8 or 16 bytes and fit into 16 bytes, `Nullable` ones
included, is packed into one key as `packFixedBatch` packs the keys of `GROUP BY`, instead of being hashed
with `SipHash` per row. A `Nullable` element is its null flag, normalized to 0 or 1, and its value, zero for
NULL. Values of 16 bytes are routed by `routeValues`, without branches.

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

* Hash the other values of the radix partitioned `uniqExact` several rows at a time

The values that are hashed with `updateHashWithValue` (tuples of strings, `Nullable` and wider values) get
the same `hash128` from `HashedJoinKey`, which hashes many rows at once with the vectorized `SipHash`. The
rows that repeat the previous one are skipped before they are hashed (`HashedJoinKey::markRepeatedRows`),
and the types it cannot hash in batches keep the per-row path.

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

* Update version_date.tsv and changelogs after v26.8.41.14-lts

* Keep each `-iquote` paired with its directory when building musl

CMake de-duplicates compile options, so only the first "-iquote" was kept
and the other two directories became stray input files. Use `SHELL:` to
keep each flag and path together.

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

* Add PromQL tests flaky with plan-based parallel replicas to the plan-based blacklist

A plan-based parallel replica cannot find the tags collected by
`timeSeriesStoreTags`, so `timeSeriesIdToGroup` throws `Unknown identifier`
when a remote replica reads part of the table.

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

* Push `empty` and `notEmpty` of a `String` column down into the Vortex scan

`optimize_empty_string_comparisons` rewrites `s = ''` and `s != ''` into
`empty(s)` and `notEmpty(s)` before the filter reaches `ReadFromFile`, and
`VortexExpressionConverter` had no handler for them, so the conjunct was dropped:
the scan decoded and converted every row of the column, and only ClickHouse
filtered it. Now they become `s = ''` and `s != ''` in the scan, which is exact in
any position; arrays, maps and UUIDs stay with ClickHouse.

ClickBench on one `hits.vortex`, 36 cores, hot run: Q10 228 -> 123 ms,
Q12 331 -> 242 ms, Q24 368 -> 212 ms, Q31 499 -> 393 ms.

https://benchmark.clickhouse.com/#system=-&type=-&machine=-ca4e|6t|ae-|ca2|6ax|cgle|6ale|3al&cluster_size=-&opensource=-&hardware=+c&tuned=+n&storage=+vr&category=-&metric=combined&best=no&queries=-

* Sync `src/Core/ServerSettings.cpp` from private repository

* Do not pack the `LowCardinality` elements of a tuple in the radix partitioned `uniqExact`

A `LowCardinality` type forwards the size of its values, but its column holds indexes into a dictionary,
so packing it read the indexes as values and counted wrong. Such tuples are hashed. The test also covers
runs of equal rows longer than a batch of hashing, with NULLs and floats.

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

* Allocate the buffers for the rows to skip exactly

`resize_fill` rounds the allocation up to a power of two, which doubles a buffer of 65536 rows.

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

* Add tuples to the performance test of the radix partitioned `uniqExact`

Packed fixed-size tuples, `Nullable` or not, and tuples hashed several rows at a time, with strings or wider
than 16 bytes.

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

* Fix `HTTPResponseParser.MatchesPocoForEverySplit` for `MalformedMessageException`

The test compared the class of the exception with the one of the legacy
`HTTPResponse::read`, which throws `MessageException` where the parser now
throws its subclass `MalformedMessageException`. Compare them as the same
class, and check the distinction between a malformed and a truncated response
in a new test `MalformedIsNotTruncated`.

Also update the comments after the merge of master, where a header that exceeds
a limit throws `HTTPHeaderLimitException` and is reported as `LIMIT_EXCEEDED`.

Address review: ClickHouse#132117 (comment)

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

* Update version_date.tsv and changelogs after v26.9.33.10-stable

* Address review: skip all fresh-`CREATE` validations of `DataLakeCatalog` when replaying stored metadata

The `auth_header` check, the `allow_database_*` gates, and the strict
settings parsing in `loadFromQuery` ran before the recovery predicate, so a
previously valid definition replayed as `CREATE` with
`isRecoveryFromStoredMetadata` could still throw and block startup. Compute
the predicate first and treat such a replay like `ATTACH` everywhere.
A forbidden header is still never sent: `RestCatalog::validateAuthHeaders`
rejects it before the first request.

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

* Add a test for obsolete access types and their group membership

`REVOKE SYSTEM` and `REVOKE ALL` must also remove a grant of the obsolete
`SYSTEM RELOAD MODEL` privilege.

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

* Pin blocks marshalling for the EXPLAIN checks of 05137, blacklist it for plan-based

The checks pass with query-based parallel replicas, so keep parallel replicas on.

ClickHouse#132869 (comment)

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

* Docs: update clickhousectl pages for clickhousectl 0.6.0

Use the new `cloud clickhouse` and `local clickhouse` command names, fix
statements that changed in 0.6.0 (project-root discovery, Query API keys,
Postgres no longer Beta, organization errors, exit codes) and cover the
new commands and flags.

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

* Address review: reject repeated grouping-set keys and the memory-bound grouping-sets merge

A deserialized `MergingAggregated` step with grouping sets now refuses an input in which a key occurs more
than once (the output header and `makeCreatingMissingKeysForGroupingSetDAG` take keys by name), and the
memory-bound merge with grouping sets, which threw a `LOGICAL_ERROR` in `transformPipeline`.

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

* Revert "Detect MemorySanitizer and UndefinedBehaviorSanitizer reports in integration tests"

* Fix nightly changelog job hanging in `changelog.py`'s `git fetch --tags`

The `Prepare changelog` job of the `Nightly` workflow has failed every night
since 2026-11-03, so ClickHouse#126190
stopped receiving updates after 2026-11-02. The generation step is killed by
`GENERATE_TIMEOUT_SEC` (40 minutes) while `changelog.py` sits in
`Fetching all tags`.

That fetch runs in the `clickhouse/style-test` container. `actions/checkout`
keeps the credentials in a separate file included via
`includeIf.gitdir:<host path>/.git`, which does not match `/wd/.git` in the
container, so the fetch is unauthenticated and uses the default refspec. It
was already 16 minutes on 2026-11-02 and is redundant: `prepare_repo` has
fetched the master history and the tags just before.

Add `--no-fetch` to `changelog.py` (it refuses a shallow repository instead of
fetching) and use it in the nightly job.

https://github.com/ClickHouse/ClickHouse/actions/runs/44444590723
https://github.com/ClickHouse/ClickHouse/actions/runs/41566219634

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

* Pin `enable_adaptive_codec_selection = 0` in `05293_autopr_statistics_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

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

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 52da073)

* Up-sync critical files from ClickHouse-private master 5dfd845349c2b0a11b24b335ea1a0ac0006b6eed

* Docs: regenerate `Protobuf` HTTP interface link

Regenerate the `Protobuf` format page after the source documentation update in ClickHouse#132918.

ClickHouse#132899

* Pin `parallel_replicas_plan_based = 0` for the reads without the privilege in `02346`

ClickHouse#133090
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=115581&sha=2b81f2df5a513b9465dd994ca03e16aea6db2158&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29
ClickHouse#115581

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

* Pin the dictionary size in 05829_parquet_array_over_many_pages

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

* Up-sync critical files from ClickHouse-private master d5e43de9252801cefdbd7fbc02460438c2815b66

* Update autogenerated version to 26.12.1.1 and contributors

* Sync MergeTreeSettings.h from private: declare isSystemDatabaseForDisks

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Document the PARTITION BY clause of INSERT INTO FUNCTION

The parser accepts an optional `PARTITION BY expr` after the table function of
`INSERT INTO [TABLE] FUNCTION`, before the column list, and the file and object
storage table functions use it for partitioned writes, but the `INSERT INTO`
reference page never mentioned it.

Add the clause to the syntax of the "Inserting using a Table Function" and
`RETURNING` sections and to the structured syntax, and add a short
"Partitioned writes" subsection with a runnable `file()` example that links to
the per-function partitioned-write sections.

The page docs/reference/statements/insert-into.mdx is generated from
ParserInsertQuery::getDocumentation() by the nightly docs regeneration, so only
the source registration changes here.

Closes: ClickHouse#132930

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

* Mark `JoinStep::clone` `[[nodiscard]]` to satisfy `clang-tidy`

The `arm_tidy` build failed with `modernize-use-nodiscard`:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=317ff1c910b87d28e30b261588ee6636cceb871a&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
PR: ClickHouse#130374

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

* Pin the randomized Parquet settings in 05833_parquet_prewhere_edge_cases

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

* Pin the randomized Parquet settings in 05835_parquet_nullable_tuple_read_memory

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

* Make test_status_counts fail with the reload's own error

`metrics_during_load` ran `SYSTEM RELOAD DICTIONARY d_slow` in a
`threading.Thread` and only joined it. A thread's exception reaches only
`threading.excepthook`, so a failed reload before the poll saw the
in-progress status was retried as a timing miss (ending in the misleading
"the metrics were never computed while d_slow was LOADING"), and in the
LOADED_AND_RELOADING check a failed reload kept the dictionary LOADED, so
its sample was accepted and the test passed with only a thread warning.

Run the reload through `ThreadPoolExecutor.submit` and call
`future.result()` on both exits of the helper, the early return and after
the sample, so a failed reload raises its own error before a sample is
retried or accepted. `result()` waits like `join()`, and the executor's
`shutdown(wait=True)` still waits for the reload when the main thread
raises. Retries, assertions and the `d_fail` part are unchanged.

Follow-up to ClickHouse#132816, as suggested in
ClickHouse#132816 (comment)

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

* Parse JSON documents in place in JSON functions instead of copying each row

* Use a per-database user name in `05836_obsolete_access_type_grants`

The test used a fixed user name, so concurrent runs in the flaky check
created, granted to, and dropped the same user, failing with `UNKNOWN_ROLE`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123854&sha=6f09c63c7c931c9e0e02bedc03c8675a14f27dee&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29
ClickHouse#123854

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

* WIP: support Array(Int8) and Array(UInt8) in the Quantized codec

Temporary commit, not built or tested yet.

- `ColumnsDescription`: accept `Int8`/`UInt8` elements, reject methods
  `int8` and `prefix` with format `int8` for them.
- `SerializationQuantizedVector`: read `Int8`/`UInt8` vectors; for
  `rabitq`/`turboquant`, `UInt8` elements are shifted by -128.
- Planner: accept integer reference literals and shift the reference
  vector the same way for `UInt8` columns.
- Docs updated.

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

* Use the `rabitq`/`turboquant` codes for `L2Distance`, add tests for byte vectors

`rabitq` and `turboquant` estimate only the cosine distance. For an
`L2Distance` query, the shortlist is now ranked by the cosine estimate and
the result is rescored by the exact `L2Distance`, instead of falling back to
the exact scan. The returned distances are exact; the recall depends on how
much the vector norms vary.

Measured on 300k vectors of Dino10B (1024-d, `UInt8`, L2), 300 queries,
recall@10 against exact L2 at fetch multiplier 1/5/10/50:
`rabitq` 0.69/0.98/0.99/1.00, `turboquant` 0.74/0.99/1.00/1.00
(with the `UInt8` shift; without it `rabitq` gets 0.11/0.27/0.35/0.59).

Also fix a `-Wdouble-promotion` error in the `UInt8` shift of the reference
vector, and add test `02354_vector_search_quantize_codec_int8_uint8`.

Dataset: https://swannbessa.github.io/blog/dino10b/

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

* Shorten the comment on `QUANTIZED_CODEC_UINT8_SHIFT`

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

* Fix `clang-tidy` in `gtest_join_step_clone`: do not ignore the `[[nodiscard]]` result of `clone`

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=130374&sha=8388bd749944f4f99fc8324968cb38dc32f2a462&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29
ClickHouse#130374

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

* Docs: regenerate reference documentation from source

* docs: sync upstream clickhouse-operator docs updates (v1alpha2 deprecations)

---------

Co-authored-by: Nikita Fomichev <[email protected]>
Co-authored-by: Groene AI <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alexey Milovidov <[email protected]>
Co-authored-by: Nikolai Kochetov <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: singhpratech <[email protected]>
Co-authored-by: Julia Kartseva <[email protected]>
Co-authored-by: Mark Dawson <[email protected]>
Co-authored-by: Konstantin Bogdanov <[email protected]>
Co-authored-by: Nihal Z. Miaji <[email protected]>
Co-authored-by: Ubuntu <[email protected]>
Co-authored-by: robot-clickhouse <[email protected]>
Co-authored-by: Pedro Ferreira <[email protected]>
Co-authored-by: Alexander Gololobov <[email protected]>
Co-authored-by: Nikolai Ovchinnikov <[email protected]>
Co-authored-by: Matheus Nerone <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Shaun Struwig <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Murphy <[email protected]>
Co-authored-by: Alex Kalmakov <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: rienath <[email protected]>
Co-authored-by: Kirill Kopienko <[email protected]>
Co-authored-by: Nikita Taranov <[email protected]>
Co-authored-by: Konstantin Vedernikov <[email protected]>
Co-authored-by: Antonio Andelic <[email protected]>
Co-authored-by: Yaroslav Briukhovetskyi <[email protected]>
Co-authored-by: Azat Khuzhin <[email protected]>
Co-authored-by: Pavel Kruglov <[email protected]>
Co-authored-by: Maksim Dergousov <[email protected]>
Co-authored-by: Nikolay Degterinsky <[email protected]>
Co-authored-by: Anton Popov <[email protected]>
Co-authored-by: Alexei Fedotov <[email protected]>
Co-authored-by: János Benjamin Antal <[email protected]>
Co-authored-by: AlexF <[email protected]>
Co-authored-by: Igor Nikonov <[email protected]>
Co-authored-by: Alasdair Brown <[email protected]>
Co-authored-by: Dominic Tran <[email protected]>
Co-authored-by: clickhouse-cloud-ci[bot] <333021140+clickhouse-cloud-ci[bot]@users.noreply.github.com>
Co-authored-by: Shaohua Wang <[email protected]>
Co-authored-by: Daniel Lemire <[email protected]>
Co-authored-by: Shankar Iyer <[email protected]>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-regular-function Regular scalar functions: string processing, data conversion, arithmetic, math, comparison, condi... groeneai-origin-request PR origin: a maintainer pinged or directed groeneai pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

3 participants