Skip to content

Fix quadratic complexity of groupConcat over FixedString - #116795

Merged
azat merged 3 commits into
ClickHouse:masterfrom
groeneai:groupconcat-fixedstring-no-per-row-cast
Aug 28, 2026
Merged

azat merged 3 commits into
ClickHouse:masterfrom
groeneai:groupconcat-fixedstring-no-per-row-cast

Conversation

@groeneai

@groeneai groeneai commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #116740

Changelog category (leave one):

  • Performance Improvement

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

Fixed quadratic complexity of groupConcat over a FixedString argument. The whole argument column was converted to String once per row, so a query over 400,000 rows took 45 seconds instead of 0.1 seconds and overran its max_execution_time, which is only checked between blocks.

Description

GroupConcatImpl::add is a per-row callback. For a FixedString argument it called castColumn
on columns[0], which converts the entire block column, then used a single row of the result and
discarded the rest. A block of B rows therefore performed B whole-column conversions. The
String path does no conversion and was unaffected.

The row's bytes are now read directly from ColumnFixedString with trailing zero bytes stripped,
which is what CAST(FixedString AS String) does. No String column is materialized.

Measured on release 26.8.1.1569 with 400,000 rows: 45.3 s before, 0.11 s after, with the
String control flat at 0.11 s. Holding rows at 80,000 and varying max_block_size gave
2.16 / 4.04 / 7.15 / 13.11 s for 8192 / 16384 / 32768 / 65409 before and a flat 0.09 s after,
which is the signature of a whole-column operation run per row. Nullable(FixedString),
LowCardinality(FixedString), the groupConcat(delimiter, limit) form and the GROUP BY path
were all affected and are all fixed, since they funnel through add.

Output is unchanged. The new test pins the byte-exact result of eight cases, including the ones
where an incorrect trim would diverge (all-zero value, zero-padded empty value, embedded zero
bytes); its reference was generated from the release binary before the change.

Found while triaging a Stress test (amd_msan) hung check on #115117, where four cancelled
groupConcat queries had run for 526 s against max_execution_time = 10:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115117&sha=fd8fc0cb566c40d549255ce68bf9ac9b9532d36a&name_0=PR&name_1=Stress%20test%20%28amd_msan%29
Requested by @ Algunenano on #115173:
#115173 (comment)

A batch of rows is still not interruptible part-way through, so cancellation latency is bounded
by one block's cost; that is common to all aggregate functions. #110511 (open) edits add two
lines above this change, for an unrelated defect. The two merge textually, but it makes an empty
value emit a delimiter, so whichever merges second has to update two .reference lines here.


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

Version info

  • Merged into: 26.9.1.231 (included in 26.9 and later)

GroupConcatImpl::add() is a per-row callback. For a FixedString argument it
called castColumn() on columns[0], which converts the entire block column, then
used a single row of the result and discarded the rest. A block of B rows
therefore performed B whole-column conversions: O(B^2) per block. The String
path does no conversion and was unaffected.

Read the row's bytes directly from ColumnFixedString instead and strip trailing
zero bytes, which is what CAST(FixedString AS String) does. No String column is
materialized, so the work is O(1) per row. Note that FixedString's own
serialization is not a substitute here: SerializationFixedString::serializeText
trims only when trim_fixed_string is set, and that defaults to false, so using
it would emit the padding bytes and change results.

GroupConcatData::insert() now delegates to a new insertString(), keeping the
offsets and num_rows bookkeeping that the has_limit specialization depends on in
one place.

On release 26.8.1.1569, 400000 rows took 45.3 s and now take 0.11 s, matching
the String control. Holding rows at 80000 and varying max_block_size gave
2.16 / 4.04 / 7.15 / 13.11 s for 8192 / 16384 / 32768 / 65409 before and a flat
0.09 s after, which is the signature of a whole-column operation run per row.
Because a single block took minutes, max_execution_time could not be honoured:
found via a Stress test (amd_msan) hung check where four cancelled groupConcat
queries had run for 526 s against a limit of 10 s.

Nullable(FixedString), LowCardinality(FixedString), the groupConcat(delim,
limit) form and the GROUP BY path were all affected and are all fixed, since
GroupConcatImpl overrides no batch method and they all funnel through add().
…tring

The previous commit added a direct ColumnFixedString byte read to the
isFixedString branch of GroupConcatImpl::add() but kept the old
whole-column castColumn path behind a checkAndGetColumn<ColumnFixedString>
miss. That fallback is unreachable, and it would not work if it were
reached, so this removes it and asserts the column type directly instead.

Unreachable: every entry point normalizes the argument column before add()
sees it. Aggregator::prepareAggregateInstructions
(src/Interpreters/Aggregator.cpp:1653) calls
convertToFullColumnIfConst()->convertToFullColumnIfReplicated() at :1674,
recursiveRemoveSparse() at :1686 and recursiveRemoveLowCardinality() at
:1691. The sparse batch entry points pass the dense values column, not the
sparse wrapper (IAggregateFunction.h:605 and :689,
&column_sparse.getValuesColumn()). WindowTransform materializes the
argument columns it needs, explicitly removing Const, LowCardinality and
Sparse (src/Processors/Transforms/WindowTransform.cpp:352-357).
arrayReduce strips LowCardinality itself
(src/Functions/array/arrayReduce.cpp:91). initializeAggregation does the
same at src/Functions/initializeAggregation.cpp:158-159, with a comment at
:150 recording that its arguments may still carry the wrapper.
AggregateFunctionFactory resolves the function through
convertLowCardinalityTypesToNested (AggregateFunctionFactory.cpp:76, used
at :99), so a LowCardinality(FixedString) argument yields a FixedString
type. The remaining way a Sparse or LowCardinality column reaches an
aggregate add() is a MergeTree merge of a SimpleAggregateFunction column,
and groupConcat is absent from that whitelist
(src/DataTypes/DataTypeCustomSimpleAggregateFunction.cpp), which closes it.

Non-functional if reached: castColumn preserves a Const, Sparse or
LowCardinality wrapper, because that is what IExecutableFunction's default
implementations do. The fallback then called GroupConcatData::insert,
which serializes through SerializationString::serializeText
(src/DataTypes/Serializations/SerializationString.cpp:394), and that
assert_casts to ColumnString at :396. So it aborts on exactly the shapes
it appears to guard, while the sibling else branch has no guard at all and
would abort identically through the argument type's own serialization.
Deleting it therefore cannot make any reachable case worse.

The serialization member's conditional existed only to serialize the
removed cast's String result. It is now read exclusively by the
non-FixedString branch, which wants the argument type's own
serialization, so the conditional is gone. argument_types[0] is the same
object as type.

Evidence for the assertion, not just for output equality: in a debug build
assert_cast is checked, so a 33 arm shape matrix was run on a debug binary
and produced output byte identical both to a build of the parent commit and
to the official release 26.8.1.2020. The arms are plain FixedString;
Nullable(FixedString) keyed and unkeyed, including all NULL groups;
LowCardinality(FixedString); LowCardinality(Nullable(FixedString));
ColumnConst bare and under materialize; a stored column with
serialization_kind = Sparse confirmed in system.parts_columns over 20000
rows, plain and grouped; multi key GROUP BY; the groupConcat(delim, limit)
form; groupConcatIf; arrayReduce over Array(FixedString),
Array(LowCardinality(FixedString)) and Array(Nullable(FixedString));
initializeAggregation over LowCardinality(FixedString); the window form
bare, partitioned and over LowCardinality; a groupConcatState and
finalizeAggregation round trip; groupConcatMergeState; and a two shard
remote() merge, whose state the official release binary reads back
unchanged when it acts as the initiator.

A negative control keeps this change and swaps only the asserted type to
one the column can never be. On it, 34 of 34 reachable arms abort; the only
two that do not are all NULL groups, where the Null combinator never calls
add(). So the clean run is a measurement rather than a blind zero.

The performance property is deliberately not asserted by a test. It is
proven by a block size sweep at constant row count, which is flat with this
change and linear in block size without it, and by a structural mutation
arm. A timing arm cannot be made deterministic here: max_block_size is
randomized per run, the suite enforces a 180 s per test ceiling that a
correct debug build already approaches under parallel load, and a long tag
would divide this file's --test-runs by ten.
`AGENTS.md` asks for literal names from the ClickHouse SQL language and
literal type names to be wrapped in inline code blocks in comments, so wrap
the expression in the `GroupConcatImpl` comment and in the header comment of
`04755_groupconcat_fixedstring.sql`.

Only comment text changed. With comments stripped the source is
token-identical to the previous commit, so the compiled code is unaffected.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Aug 27, 2026
@groeneai

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

Pre-publication review by an independent model, plus an independent cold review of the resulting
code by a reviewer that never edits it (engine: codex; 3 review rounds, 2 fix rounds; the last two
rounds raised nothing new).

# Sev Finding Verdict Evidence / action
1 ⚠️ The regression test passes with both the old and the new implementation, so it does not pin the complexity. Asks for a deterministic performance oracle pinning block size. AGREE on the fact, DISAGREE on the remedy The test is a byte-exactness guard by design, because a wrong trim is the wrong-results risk here; deleting only the trim reddens 7 of its 8 arms, so it is not vacuous. The requested oracle cannot be made deterministic in this suite: max_block_size is randomized to 8000..100000 (tests/clickhouse-test:1508), a run over 180 s fails on the flaky check (TEST_MAX_RUN_TIME_IN_SECONDS, :198 and :3555), and a long tag to survive that ceiling divides this file's --test-runs by ten (apply_test_runs, :4369). There is no non-timing counter either: castColumn increments no ProfileEvent, and the full 45-key ProfileEvents map is identical on both arms apart from time keys. A tests/performance/*.xml case was considered and declined: none of the 555 existing ones covers groupConcat, and the closest precedent, #113140, fixed a cubic planning complexity with source plus two stateless tests and no performance test. The complexity is instead shown by the block-size sweep in the description and the commit message.
2 ⚠️ The first version kept the old whole-column castColumn call as a fallback, so the O(1) guarantee was conditional and the trailing-zero trim existed twice. AGREE, fixed The fallback was unreachable, and could not have worked if reached: castColumn preserves a Const, Sparse or LowCardinality wrapper, and the fallback then serialized through SerializationString, which assert_casts to ColumnString. Deleted, with the now unused include and a serialization ternary that only existed to serialize the removed cast's result. Unreachability is measured, not argued: an instrumented build counted 0 fallback entries against 20 fast-path entries over a 33-arm shape matrix and 20,000 rows of a confirmed Sparse column, and a negative control asserting to ColumnString aborted 34 of 34 reachable arms. Reading the callers agrees: each add caller in src strips Const, Sparse, LowCardinality and Replicated first, and neither merge-time caller can reach the branch, since groupConcat is absent from the SimpleAggregateFunction whitelist and GraphiteMergeTree requires a Float64 value column.
3 💡 Asks for extra test arms covering FixedString nested in Tuple, Array and Map. DISAGREE Those arms guard a rejected variant of this fix that flipped the global trim_fixed_string format setting, which does change results for composite types. The shipped branch is entered only when the argument type is FixedString at top level, so a composite argument keeps the untouched else path and its bytes are produced by exactly the code already in master. An arm there would assert behaviour this change does not touch.

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

Session id: cron:clickhouse-review-slot-10:20260827-204100

@clickhouse-gh clickhouse-gh Bot closed this Aug 27, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 27, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, no randomization needed. clickhouse local -q "SELECT length(groupConcat(',')(x)) FROM (SELECT CAST('abc','FixedString(3)') AS x FROM numbers(400000))" takes 46.05 s on release 26.8.1.1569; the same query over String takes 0.11 s.
b Root cause explained? GroupConcatImpl::add() is a per-row callback. On the isFixedString branch it calls castColumn(columns[0], String), which converts the entire block column, then consumes one row (row_num) and discards the rest. addBatchSinglePlace/addBatch call add() once per row, so a block of B rows performs B whole-column conversions: O(B^2) per block. Proven by holding rows at 80,000 and varying max_block_size: 2.16 / 4.04 / 7.15 / 13.11 s for 8192 / 16384 / 32768 / 65409, i.e. linear in block size at constant row count, which only a whole-column operation run per row produces.
c Fix matches root cause? Yes. It removes the whole-column work rather than making it cheaper: the row's bytes are read directly from ColumnFixedString (fixed width, contiguous) with the trailing-zero trim applied inline. O(1) per row, no allocation. Rejected on measurement: caching the cast function memoizes the function object, not the result, so all B conversions still run; overriding one batch entry point would leave the GROUP BY path (which uses addBatch) quadratic.
d Test intent preserved / new tests added? New test 04755_groupconcat_fixedstring added, asserting byte-exact hex() output for eight cases. No existing test was modified or weakened. The three load-bearing arms (all-zero value, zero-padded empty value, embedded zero bytes) are where an incorrect trim diverges.
e Both directions demonstrated? Yes. Performance: block-size sweep goes from 2.16/4.04/7.15/13.11 s (base) to a flat 0.09 s (fixed), same binary flavour, Build-ID verified on each arm. Semantics: reverting only the trim reddens 7 of the 8 test arms, including all three load-bearing ones, so the oracle is not vacuous. Output is byte-identical between the pre-change release binary and the patched build across all arms.
f Fix is general across code paths? Yes. GroupConcatImpl overrides no batch method, so addBatchSinglePlace, addBatch (GROUP BY), addBatchSinglePlaceNotNull and addBatchSparseSinglePlace all funnel through add() and are fixed at once. Measured quadratic before and flat after: plain, Nullable, LowCardinality, toFixedString(), the groupConcat(delim, limit) form, and GROUP BY. mergeImpl, insertResultInto, serialize and deserialize do not cast and are untouched. groupConcat was the only castColumn caller under src/AggregateFunctions/, so no sibling has this pattern.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. A 33-arm shape matrix runs byte-identical against the official release binary 26.8.1.2020 and against a build of the parent commit: FixedString(1), (3), (4), (5), (255); Nullable(FixedString) including an all-NULL group, keyed and unkeyed; LowCardinality(FixedString); LowCardinality(Nullable(FixedString)); ColumnConst bare and under materialize; a stored column with serialization_kind = Sparse confirmed in system.parts_columns over 20,000 rows; empty group; embedded and trailing zero bytes; limit = 1..3; multi-key GROUP BY. The exotic entry points are covered too: groupConcatIf, arrayReduce over Array(FixedString), Array(LowCardinality(FixedString)) and Array(Nullable(FixedString)), initializeAggregation over LowCardinality(FixedString), the window form bare and partitioned, a groupConcatState / finalizeAggregation round trip, groupConcatMergeState, and a two-shard remote() merge whose state the official release binary reads back unchanged. Every arm ran on a debug build, where the branch's assert_cast is checked.
h Backward compatible? Yes. No setting, no default change, no serialization-format change, so no SettingsChangesHistory.cpp entry is required. The aggregate state layout is untouched: the new row-insert helper writes the same bytes, offsets and num_rows as the code it replaces. Confirmed on the wire by running the two-shard remote() arms with the official release binary as the initiator against a shard running this build, and with a parent-commit build as the initiator: byte-identical in both directions.
i Invariants and contracts preserved? Yes. The GroupConcatData invariant is that each row appends its bytes and pushes exactly two offsets while incrementing num_rows, which has_limit's getSize/getString, mergeImpl and serialize/deserialize all depend on. insert() was refactored to delegate to the new insertString(), so that bookkeeping exists in one place and both callers share it; a bare insertChar would have appended bytes without offsets and corrupted the has_limit state. Guarded by 03195_group_concat_deserialization_fix and 04238_group_concat_second_arg_preserves_limit, both passing. The branch's own precondition is that columns[0] is a ColumnFixedString whenever isFixedString(type) holds, which it asserts directly: the aggregator materializes constants and strips Sparse and LowCardinality, the sparse batch entry points pass the dense values column, the Null combinator passes the nested column, and groupConcat is absent from the SimpleAggregateFunction whitelist, which closes the merge-time path. That is a measurement, not a reading: all 33 arms in row (g) ran on a debug build where the assertion aborts on a miss, and a negative control that asserts to ColumnString instead aborts 34 of 34 reachable arms, the only exceptions being two all-NULL groups where the Null combinator provably never calls add().

Session id: cron:clickhouse-impl-slot-7:20260827-185400

@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1f73034]

Summary: ❌

job_name test_name status info comment
Stress test (arm_debug) FAIL
Logical error: 'Inconsistent AST formatting: the query: (STID: 1941-26fa) FAIL cidb, issue

AI Review

Summary

This PR removes the per-row whole-column castColumn from groupConcat over FixedString, replaces it with direct reads from ColumnFixedString, and refactors the row-append bookkeeping through insertString. After tracing the unchanged aggregation, combinator, arrayReduce, initializeAggregation, window, sparse, and merge/state paths, I did not find a live correctness or compatibility regression in the current diff.

Missing context / blind spots
  • ⚠️ The aggregate PR report and Build (arm_tidy) check were still pending while I reviewed the patch, so some CI/toolchain coverage remains outstanding beyond this code review.
Final Verdict

✅ No new inline findings for the current patch.

LLVM Coverage Report

Measured on commit 1f73034.

Metric Baseline Current Δ
Lines 88.40% 88.40% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 80.80% 80.70% -0.10%

Changed lines: Changed C/C++ lines covered: 19/19 (100.00%) · Uncovered code

Full report · Diff report

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @azat @alexey-milovidov, could you review this? For a FixedString argument groupConcat called castColumn on the whole block column once per row and then used a single row of the result, so add was quadratic in the block size: 45.3 s for 400,000 rows against 0.11 s for the same query over String. It now reads the row directly from ColumnFixedString and strips trailing zero bytes, which is what CAST(FixedString AS String) already does, so the output is byte-identical.

@clickhouse-gh

clickhouse-gh Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 1f730344b with master ca27b5fb0 (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
Binary Master PR Δ
programs/clickhouse-stripped 712.36 MiB 709.31 MiB -3.06 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

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

Job report

@clickhouse-gh

clickhouse-gh Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

no significant changes detected. K_source=6 K_base=30 flagged=0/65

clickbench

🟢 No significant changes

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: 10c00dd7-7887-4f46-87f3-feba42009569
  • MIRAI run: e837d12e-8bae-4fd2-9e6d-44434e30d0cb
  • PR check IDs:
    • clickbench_124366_1787883850
    • clickbench_124379_1787883850
    • clickbench_124389_1787883850
    • tpch_adapted_1_official_124398_1787883850
    • tpch_adapted_1_official_124423_1787883850
    • tpch_adapted_1_official_124438_1787883850

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger for 1f73034

Every failure below has an owner: a fixing PR (ours 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
Stress test (amd_debug) / Inconsistent AST formatting on CREATE TABLE ... AS numbers(1000) PRIMARY KEY tuple(number) (STID 1941-26fa) pre-existing trunk logical error #116645 (ours, merged 2026-08-28)
Stress test (arm_debug) / same signature, ... AS remote('127.0.0.{3,4,5,6}', 'system.numbers') PRIMARY KEY tuple(number) (STID 1941-26fa) pre-existing trunk logical error #116645 (ours, merged 2026-08-28)
Stress test (arm_release) / Not-ready Set is passed as the second argument for function 'globalNotIn' (STID 0250-3e49) pre-existing trunk logical error #102308 (external, open)

Three reds out of 361 checks. CH Inc sync is still pending and is the only other non-green entry;
Config Workflow, Finish Workflow and Mergeable Check all succeeded.

This head has two full workflow runs (33118191541 and 33118202599), so I read the per-run
check-runs rather than the aggregated report, which keeps only the last writer. That gives a free
negative control at an identical tree: arm_release failed in the first run and passed in the
second, while amd_debug and arm_debug passed in the first and failed in the second. Every one of
the three reds passed on the same tree in its sibling run, so all three are state and timing
dependent, not tree dependent.

Owner evidence, STID 1941-26fa: the aborts are the PRIMARY KEY tuple(col) hoist, where a table
created from a table function formats back as an inline PRIMARY KEY column modifier that the parser
then rejects. That is exactly what #116645 rejects, and it merged at 2026-08-28 01:10:23Z, about four
hours after this head was pushed, so this build predates the fix (compare of the merge commit
against this head returns diverged, behind 6195). In 30 days the signature has 207 rows across 146
pull requests plus 5 runs on master. I deliberately did not merge master to pick the fix up: the
reds do not gate this PR (Mergeable Check is green, mergeable is MERGEABLE), and a push here
would cost a reviewer a manual workflow approval and invalidate a review request that is a few hours
old. #116645 is already in the post-merge verification window.

Owner evidence, STID 0250-3e49: globalNotIn reaches FunctionIn::executeImpl with a set whose
in-place build failed and whose subquery plan was never restored, which is the mechanism #102308
addresses.

This PR changes only how groupConcat casts a FixedString argument, so it cannot reach either the
AST formatter or the set-build path.

Session id: cron:our-pr-ci-monitor:20260828-030000

@azat azat self-assigned this Aug 28, 2026
@azat
azat added this pull request to the merge queue Aug 28, 2026
@azat

azat commented Aug 28, 2026

Copy link
Copy Markdown
Member

@groeneai send a follow up to remove GroupConcatDataBase, it is useless this days. And ping me there.

Merged via the queue into ClickHouse:master with commit 438a618 Aug 28, 2026
357 of 362 checks passed
@groeneai

Copy link
Copy Markdown
Collaborator Author

Acknowledged. I will send a separate PR removing GroupConcatDataBase and ping you there.

@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 28, 2026
UberDever pushed a commit to UberDever/ClickHouse that referenced this pull request Aug 31, 2026
`GroupConcatData` was the only struct deriving from `GroupConcatDataBase`, and no
other place in the tree named the base: it is mentioned exactly five times, all of
them definitional. So it existed only to hold three fields and two helpers used by
that single struct. Fold them into `GroupConcatData`, keeping every surviving field
and method byte for byte.

`GroupConcatDataBase::insert` was unreachable. `GroupConcatData::insert` has the
identical signature and hides it, the sole call site is `GroupConcatImpl::add` on a
`GroupConcatData` object, and since the five mentions are all definitional there is
no qualified call and no base reference anywhere that could reach it. The linker
already discarded all three base definitions as unreferenced. The base body was
also wrong for the only struct that could reach it: it writes through `insertChar`,
which bumps `data_size` but never pushes the `offsets` pair nor increments
`num_rows`, so calling it would corrupt the `has_limit` bookkeeping. Merging the
two structs makes the identical signatures collide, so the dead one is deleted
rather than carried over.

No behaviour change and no format change. `serialize` and `deserialize` are
untouched and the state keeps the same fields in the same order, so
`sizeof(GroupConcatData)` and `alignof(GroupConcatData)` stay at 64 and 8, every
field keeps its offset, and `std::is_trivially_destructible_v` stays false, which
covers all three properties `IAggregateFunctionDataHelper` reads.
`std::is_standard_layout_v` becomes true, which nothing reads for this type.

The 14 existing tests that exercise `groupConcat` pass with no reference change.
As a check that they can actually see a botched flattening, keeping the base body
instead of the derived one fails three of them, on the `has_limit` lines of
`03156_group_concat`, `04238_group_concat_second_arg_preserves_limit` and
`04416_groupconcat_tuple_sparse_subcolumn`.

Related: ClickHouse#116795
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 groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect pr-performance Pull request with some performance improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

groupConcat over FixedString casts the whole block column once per row

3 participants