Skip to content

Do not put a row into a dictionary source's pipeline header - #116378

Merged
rienath merged 4 commits into
ClickHouse:masterfrom
groeneai:fix-direct-dictionary-header-rows-116269
Aug 31, 2026
Merged

rienath merged 4 commits into
ClickHouse:masterfrom
groeneai:fix-direct-dictionary-header-rows-116269

Conversation

@groeneai

@groeneai groeneai commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

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 a logical error (... to have 0 rows, but it has 1: while executing function materialize) when a dictionary with LAYOUT(DIRECT()) was read through the merge table function. Closes #116269.

Description

Closes: #116269

On a released build (26.7.5), reading a LAYOUT(DIRECT()) dictionary through merge is rejected with
Code: 49. Expected the argument ... to have 0 rows, but it has 1: while executing function materialize. Being a LOGICAL_ERROR, it aborts debug and sanitizer builds.

Root cause. A block used as a pipeline header must have 0 rows. createSampleBlock
(DictionarySourceFactory.cpp) deliberately builds a dictionary source's sample block with one row per
column, and that block reached the source's output port unchanged. DirectDictionary::read is the only
layout that forwards the raw source pipeline instead of rebuilding a header from the dictionary
structure, so that header reaches StorageMerge, which wraps every child output in materialize and
evaluates it with input_rows_count = 0, and checkFunctionArgumentSizes throws.

The change. Strip the rows where the block becomes an output port header: the two
SourceFromQueryPipeline constructors in DirectDictionary.cpp, which is what
DirectDictionary::read hands to StorageMerge, plus the source constructors passing the block
straight to ISource. The block given to getInputFormat stays populated on purpose: ORC
materializes a column missing from the payload as header_column.column->cloneResized(num_rows),
reading the row createSampleBlock seeds with the attribute's null_value. Four constructors likewise
keep a populated member as a parse schema, per the existing MySQLSource / PostgreSQLSource split.

Validation. The stateless test 05043_direct_dictionary_in_merge points the dictionary at the
server's own HTTP interface, so it needs no fixture and is parallel-safe. A pre-fix master debug build
aborts on it with the exact message above, 4 of 4 randomized runs; here it passes 10 of 10 randomized
and 4 of 4 concurrent runs. Reverting only the SourceFromQueryPipeline change reddens the same query.
A FLAT dictionary declaring counter UInt32 DEFAULT 999 over an ORC payload carrying only the key
returns 999 on master and here, and 7 on every arm once the payload includes the column.


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

Version info

  • Merged into: 26.9.1.444-master (included in 26.9 and later)
  • Backported to: 26.8.11.51

A block used as a pipeline header must have 0 rows, but a dictionary source's
sample block has one row per column by construction: createSampleBlock
(DictionarySourceFactory.cpp) fills the key columns with insertDefault() and the
attribute columns with the declared null_value.

HTTPDictionarySource passed that block verbatim as the input format's header, and
the format chain forwards it unchanged, so the source's output port header carried
a row. DirectDictionary::read is the only layout that forwards the raw source
pipeline instead of rebuilding a header from the dictionary structure, so the
illegal header escaped to StorageMerge, which wraps every child output in
materialize and evaluates it with input_rows_count = 0. checkFunctionArgumentSizes
then compared 1 against 0:

  Expected the argument N1 ('word' of type String) to have 0 rows, but it has 1:
  while executing function materialize

reachable from ordinary SQL on a released build by reading a LAYOUT(DIRECT())
dictionary through merge(). Layouts other than DIRECT build their headers from the
dictionary structure via DictionarySourceCoordinator, which uses
type->createColumn(), so they were already unaffected.

Empty the block at each of the 10 places where it becomes a pipeline header. This
generalizes the guard that ClickHouseDictionarySource has carried since
4587947 "DirectDictionary updated" (2021), which added it to that one
source.

Four of these constructors use the sample block for two purposes at once, the
ISource port header and a parse schema or default-value source kept in a member, so
only the header argument is emptied and the member is left alone, following the
existing MySQLSource and PostgreSQLSource split. That distinction is load-bearing
rather than stylistic: MongoDBSource::insertDefaultValue does
insertFrom(sample_column, 0), reading row 0 of its member as the value substituted
for every absent or null BSON field, which for a dictionary is the user's declared
NULL_VALUE. Emptying the member would read out of bounds or silently substitute a
different value, which is also why the smaller-looking fix of emptying
createSampleBlock itself was rejected. RedisSource and CassandraSource still hand
the full block to description.init, and ExternalResultDescription::init refills
empty columns, so RedisSource's description.sample_block.rows() == 0 early-exit is
unaffected.

The new test uses an HTTP source because it is the only one that both supports
selective load, which LAYOUT(DIRECT()) requires, and is actually fixed here: the
ClickHouse source was already guarded and a FILE source cannot be used with
LAYOUT(DIRECT()) at all.

Closes: ClickHouse#116269
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Aug 25, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review

An independent cold review plus a second-model gate ran over this change before publication. Two
rounds; the second returned no findings from either reviewer.

# Finding Verdict
❌ Commit message claimed 45879472d3b19fb was "the very commit that introduced the raw-pipeline forwarding" AGREE, fixed. False: git show 45879472d3b19fb^:src/Dictionaries/DirectDictionary.cpp already contains return source_ptr->loadAll();, which git log --reverse -S dates to b2993c314c46472 (2020-05-07), an ancestor of both that commit and master. The guard half was correctly attributed (cloneEmpty count 0 in the parent, 1 in the commit), so the clause was deleted rather than replaced with another history claim.
💡 "Four of these sources use the sample block for two purposes" AGREE, fixed. Four constructors across three sources: MongoDBSource, YTsaurusSource (two constructors), ShellCommandSource.
💡 Regression test carried an unnecessary no-fasttest tag AGREE, fixed. tests/clickhouse-test:2944 is the only place the tag gates execution, and 17 of the 29 .python-based stateless tests do not carry it, including the HTTP-server siblings 01854_HTTP_dict_decompression, 02205_HTTP_user_agent and 02233_HTTP_ranged. The tag cost coverage in the cheapest suite and bought nothing.

Checked and found sound, so raised as no finding:

  • Carrier completeness. Every ISource base initialization and every getInputFormat call under
    src/Dictionaries/ and src/Processors/Sources/ was enumerated independently of the change, along
    with all 14 IDictionarySource subclasses. The 10 fixed sites and the already-correct ones
    (ClickHouseDictionarySource, MySQLSource, PostgreSQLSource, SQLiteSource, ArrowFlightSource,
    YAMLRegExpTreeDictionarySource) partition that set exactly.
  • Dual-purpose blocks. At the four constructors that keep the block as a parse schema or
    default-value source, only the port-header argument is emptied. This is load-bearing:
    MongoDBSource::insertDefaultValue does insertFrom(sample_column, 0), reading row 0 of the member
    as the value substituted for absent or null BSON fields, which for a dictionary is the declared
    NULL_VALUE.
  • Emptied headers do not break consumers. Port::connect validates through
    assertCompatibleHeader -> checkBlockStructure -> checkColumnStructure, which compare column
    count, names, types and column structure and never row counts, so an empty header is compatible with
    populated chunks. None of the five touched sources reads its own port header in generate().
  • Temporary lifetime. Three hunks pass a Block temporary to a const Block & parameter. Nothing
    retains it: all 46 registerInputFormat and registerRandomAccessInputFormat creators copy it into
    a Block owned by the format, and ParallelParsingInputFormat::Params holds the header by value
    with a by-value lambda capture.
  • ExternalResultDescription refill. RedisSource and CassandraSource still call
    description.init on the original block, so RedisSource's description.sample_block.rows() == 0
    early exit is unaffected.
  • Test liveness. The merge arm is the defect itself, and it reddens again under a revert of only
    the HTTPDictionarySource hunk with the other nine kept, which binds it to the fixed site rather
    than to an unrelated cause.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, 100% (not probabilistic). CREATE DICTIONARY d (word String, counter UInt32) PRIMARY KEY word SOURCE(HTTP(URL '<local CSV>' FORMAT 'CSV')) LAYOUT(DIRECT()); SELECT * FROM merge(currentDatabase(), '.*'); aborts the debug build with Logical error: 'Expected the argument N1 ('word' of type String) to have 0 rows, but it has 1'.
b Root cause explained? Yes. A pipeline header must have 0 rows. createSampleBlock (DictionarySourceFactory.cpp:23-63) builds the source's sample block with one row per column; HTTPDictionarySource.cpp:99 passed it verbatim as the input-format header, so the source's output port header carried a row. DirectDictionary::read is the only layout forwarding the raw source pipeline instead of rebuilding a header from the dictionary structure, so it reaches StorageMerge, which wraps children in materialize; ActionsDAG::updateHeader evaluates with input_rows_count = 0 and checkFunctionArgumentSizes (FunctionHelpers.cpp:530) throws. Locally captured stack matches frame for frame.
c Fix matches root cause? Yes. The illegal 1-row header is emptied at the boundary that creates it. Not a guard at the detector (checkFunctionArgumentSizes), which would be the symptom fix; no widened bound, relaxed assertion or defensive check. Mirrors the existing ClickHouseDictionarySource.cpp:169-170 guard, added to that one source in 45879472d3b19fb (2021).
d Test intent preserved / new tests added? Yes. New stateless test 05043_direct_dictionary_in_merge (.sh + .python + .reference); no existing test weakened or removed. Parallel-safe (runner-scoped database, free-port HTTP server), so no no-parallel tag. SQL/shell rather than a C++ gtest.
e Both directions demonstrated? Yes. Test FAILS on pristine master (Build ID 248528f3392aab9a, aborts at the merge(...) assertion with the exact message) and PASSES with the fix (21a040a3c02657c0, 1.04s). Negative control: reverting only the HTTPDictionarySource hunk while keeping the other nine (b666149607f8b25c) reddens it again, so the test is bound to the fixed site.
f Fix is general across code paths? Yes. All 10 header boundaries fixed, not only the reported HTTP one: HTTPDictionarySource, XDBCDictionarySource, FileDictionarySource, NullDictionarySource, RedisSource, CassandraSource, MongoDBSource, ShellCommandSource (one edit covering all four Executable* sources and StorageExecutable), YTsaurusSource x2. Already-correct sites deliberately untouched: ClickHouseDictionarySource, MySQLSource, PostgreSQLSource. Non-DIRECT layouts build headers from the dictionary structure via DictionarySourceCoordinator (type->createColumn(), 0 rows) and were already safe.
g Fix generalizes across inputs (params/datatypes/wrappers)? Yes. cloneEmpty is type-agnostic: it preserves every column's name and type and drops only rows, so Nullable / LowCardinality / LC(Nullable) / Array / Map / Const are unaffected by construction. Test covers the reported String + UInt32 shape plus a second layout (complex_key_hashed).
h Backward compatible? (maintainer-approved exception only) Yes. No setting added or default changed, no serialization or format change, no API/header change, so no SettingsChangesHistory.cpp entry is required.
i Invariants and contracts preserved? Yes. Four constructors, across three sources, use the sample block for two purposes, the ISource port header AND a parse schema / default-value source held in a member. Only the header argument is emptied; every member is untouched, per the MySQLSource.cpp:76-81 / PostgreSQLSource.cpp:37,53 precedent. This is required for correctness: MongoDBSource::insertDefaultValue (:35) does column.insertFrom(sample_column, 0), reading row 0 of the member as the value substituted for absent BSON fields, which for a dictionary is the declared NULL_VALUE; YTsaurusSource's member is the JSONEachRowRowInputFormat schema (:57) and ShellCommandSource's is the input-format schema (:572, :683). Verified that RedisSource::generate's description.sample_block.rows() == 0 early-exit (:118) is NOT tripped: it reads description, a different object from the port header, and ExternalResultDescription::init refills empty columns anyway.

Session id: cron:clickhouse-impl-slot-7:20260825-114100

@clickhouse-gh

clickhouse-gh Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [628a6f4]

Summary: ✅


AI Review

Summary

This PR fixes the one-row pipeline-header invariant violation for DirectDictionary reads by emptying headers at the SourceFromQueryPipeline boundary and at the source constructors that published dictionary sample blocks directly, while still keeping populated sample blocks where parsers or default-value synthesis need row 0. After checking the current diff, the surrounding source/dictionary wiring, and the prior review threads, I found no remaining correctness, safety, or coverage issues in the current head.

Final Verdict

Status: ✅ Approve

LLVM Coverage Report

Metric Baseline Current Δ
Lines 87.30% 87.30% +0.00%
Functions 91.90% 91.90% +0.00%
Branches 79.40% 79.40% +0.00%

Changed lines: Changed C/C++ lines covered: 23/35 (65.71%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Aug 25, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @nihalzp @vitlibar, could you review this? A dictionary source's sample block carries one row per column by construction, and HTTPDictionarySource passed it verbatim as the input format's header, so the source's output port header had a row in it; LAYOUT(DIRECT()) is the only layout that forwards that raw pipeline, so reading such a dictionary through merge reached checkFunctionArgumentSizes with 1 row where 0 were expected. This empties the block at the 10 places where it becomes a pipeline header.

@PedroTadim

Copy link
Copy Markdown
Member

cc @alexey-milovidov you can look at this

…ress family

The fallback URL in the test bracketed CLICKHOUSE_HOST whenever the local HTTP
server had been bound to an IPv6 address. Those are independent: with
CLICKHOUSE_HOST set to a name that resolves to an IPv6 address, the fallback
built http://[<name>]:<port>, and urllib rejects a bracketed name with
ValueError: '<name>' does not appear to be an IPv4 or IPv6 address.

Bracket only when the host parses as an IPv6 literal, and leave a name
unbracketed.

Measured on the fallback path across four spellings of CLICKHOUSE_HOST
(127.0.0.1, ::1, localhost, ip6-localhost): before, ip6-localhost raised that
ValueError before any query ran; after, all four pass. Inverting the guard's
polarity fails 127.0.0.1 with "An IPv4 address cannot be in brackets",
confirming the branch is reached.
@clickhouse-gh

clickhouse-gh Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 628a6f4c1 with master 9d8eed34c (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 711.97 MiB 708.91 MiB -3.05 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

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

Job report

…he pipeline head

The input format is not only a schema consumer. ORC synthesizes a column that is
absent from the payload as header_column.column->cloneResized(num_rows), and
createSampleBlock seeds that column object with the attribute's configured
null_value, so emptying the block passed to getInputFormat made a payload that
omits an attribute produce the type default instead of the declared value.

Measured on a FLAT dictionary with counter UInt32 DEFAULT 999 over an ORC payload
carrying only the key column: master and this commit both return 999, while
emptying the getInputFormat argument returned 0. A payload that does include the
column returns 7 on every arm.

Pass the populated block to the format again, and strip the rows where the header
actually reaches an output port instead: the two SourceFromQueryPipeline
constructors, which are what DirectDictionary::read hands to StorageMerge. That is
the only place the sample row escaped into a port header, so the rest of the
sources keep the blocks they parse and default with.

Reverting only the SourceFromQueryPipeline change reproduces the original logical
error from issue 116269 with the same message, and 05043_direct_dictionary_in_merge
passes on this commit while aborting on master.
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - d4ed84f

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
Docker server image / clickhouse/clickhouse-server:head-arm64 apt mirror returned 503 for three .deb fetches, retries exhausted 2/2, Canonical mirror fallback never selected #116441 (ours, open)

The whole test matrix ran on this head: 38/38 Stateless tests legs OK, 27/27 Build legs OK,
Fast test and Fast test (arm_darwin) OK, Config Workflow and Style check OK, 154 of 176
praktika nodes OK with 0 DROPPED (the 19 SKIPPED are the conditional jobs: targeted/flaky
integration, bugfix validation, master_head performance, PGO toolchain). CIDB holds 12 non-green
rows of 308,174 at this head; 10 are passing tests inside that same failed job, so the 2 ownable
rows are the job-level failure and its head-arm64 leaf, both the one check above.

Why #116441 owns this and not the already-merged #115726: the mirror-2 fallback #115726 added is
present in the tree that ran and never engaged. Its gate anchors on ERROR: failed to solve:
while buildx prints ERROR: failed to build: failed to solve:, so terminal_build_failure fails
closed to the empty string and is_apt_mirror_failure is always false. ci/jobs/docker_server.py
at this exact head carries that anchor (and not the corrected literal), the job log contains the
shipped anchor 0 times and the real sentence 3 times, logs apt mirror 1/2 six times and
apt mirror 2/2 zero times, and has no exhausted its retries line. #116441 corrects the literal.

Not caused by this PR: the diff is src/Dictionaries/*, src/Processors/Sources/* and one
stateless test, none of which participates in building a Docker image. Breadth over 7 days is 612
Docker * image failure rows across 35 pull requests plus 133 on master, first seen 2026-08-21.

Session id: cron:our-pr-ci-monitor:20260826-050000

@rienath rienath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good temporary patch, but it needs a redesign because at some point someone will forget to write std::make_shared<const Block>(...->cloneEmpty() and we'll end up with this problem again. Could you please file a follow-up with infrastructural fix and ask the owner of this code (the author if they're still with us or, if not, the component expert) for a review.

For this PR, please remove the comment you left in DirectDictionary and write a laconic one in createSampleBlock s.t. maintainers remember to do this trickery next time in the caller.

You can also simplify the test into roughly 15 line .sh file. Please try to do it

@rienath rienath self-assigned this Aug 26, 2026
…ession test

The one-row block is built in createSampleBlock, so the note about a pipeline header
needing no rows belongs there: that is what a caller adding a new dictionary source
reads before publishing the block as its header.

The test no longer needs its own HTTP server. Pointing the dictionary at the server's
own HTTP interface reproduces the same logical error in 15 lines. Against a pre-fix
master debug build the test kills the server on 4 of 4 randomized-settings runs with
"Expected the argument No 1 ('word' of type String) to have 0 rows, but it has 1";
with the fix it passes 10 of 10 randomized runs and 4 of 4 concurrent runs.

Co-Authored-By: Claude Opus 5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Done for this PR in 628a6f4:

  • Comment removed from DirectDictionary and replaced with two lines on createSampleBlock in DictionarySourceFactory.cpp, where the one-row block is actually built: it holds one row per column, and a source that publishes it as a pipeline header has to strip the rows first.
  • The 154-line .python fixture is gone and the test is a 15-line .sh. Instead of starting its own HTTP server it points the dictionary at the server's own HTTP interface, the same idiom 03519_storage_url.sh uses. A pre-fix master debug build aborts on it with the original message on 4 of 4 randomized-settings runs; here it passes 10 of 10 randomized and 4 of 4 concurrent runs, at 0.6 s.

The source delta in that commit is comment-only, so behaviour is identical to the head that already finished CI.

The infrastructural fix goes in a separate PR. I will cc the owner of that code there rather than here, and link it in this thread.

@groeneai

Copy link
Copy Markdown
Collaborator Author

The infrastructural fix is #116641. It drops the rows once in ISource, the single constructor every source port header passes through, so no source has to remember the strip by hand, and NativeORCBlockInputFormat keeps the block it was handed for the one place that reads row 0. No file overlaps with this PR, so the two are independent.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 628a6f4

CI is fully finished at this commit. One check failed, and it has an owner.

Check / test Reason Owner / fixing PR
Stress test (arm_tsan) / Cannot start clickhouse-server trunk bug, server refuses to start after the stress restart. The metadata load hits Code: 36 BAD_ARGUMENTS: Alias table cannot refer to another Alias table while attaching test_3.outer_alias_to_inner_alias, which becomes Code: 695 then Code: 722 and fails the whole load. Not caused by this PR: the diff touches dictionary sources and src/Processors/Sources, creates no Alias table, and the signature has 32 occurrences across 28 unrelated pull requests plus 4 on master in 30 days. #116153 (ours, open)

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116378&sha=628a6f4c16db51575c7c7d7ab3381badd834aa00&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29

Everything else at this commit is green: 178 praktika nodes, 155 OK and 19 SKIPPED, none dropped, and Config Workflow, Style check and Finish Workflow all OK. The only failing job is the one above.

Session id: cron:our-pr-ci-monitor:20260827-060000

@rienath
rienath enabled auto-merge August 31, 2026 12:25
@rienath
rienath added this pull request to the merge queue Aug 31, 2026
Merged via the queue into ClickHouse:master with commit dc90345 Aug 31, 2026
353 of 354 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 31, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

The 26.8 release branch still aborts with the defect this PR fixed. @alexey-milovidov, could you add v26.8-must-backport here?

Stress test (amd_tsan) on 26.8 at 84aba704, 2026-09-25 09:34Z:

Logical error: 'Expected the argument №1 ('word' of type String) to have 0 rows, but it has 1'.

That is byte for byte the message #116269 quotes, down to the column name and the 0-vs-1 counts. Report

What I measured:

  • dc90345b is not an ancestor of 26.8 (compare/26.8...dc90345b is diverged, ahead_by 3666), and DirectDictionary.cpp there has 0 occurrences of the cloneEmpty() change. 26.9 already contains the merge commit, so a version-specific label is a no-op for it and yields just the one 26.8 backport.
  • The cherry-pick is clean. Seven of the eight source files are byte-identical at 26.8 and at the merge's first parent 0afff358, and the two test files are new. The eighth, ShellCommandSource.cpp, differs only at two dropped disableProfileEventUpdate() calls and one timeout constant; the line the patch rewrites, : ISource(sample_block_), is present verbatim at line 506 with identical context.
  • CIDB over 45 days has 3 rows for this STID and none on head_ref = 'master' since the merge, so master is clean and only the LTS branch is affected.

I am asking for 26.8 only, where the failure is observed. 26.7 and 26.3 also lack the change, but I have no occurrence on either, so pr-must-backport would be wider than my evidence. Happy to go wider if you would rather cover the whole ladder.

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 25, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 25, 2026
PedroTadim added a commit that referenced this pull request Sep 25, 2026
Backport #116378 to 26.8: Do not put a row into a dictionary source's pipeline header
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 2, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 12, 2026
…ops the rows

ClickHouse#116378 has merged, so master carries nine hand-written
`std::make_shared<const Block>(...->cloneEmpty())` strips, plus a third
YTsaurus one that a later PR copied (Cassandra, Redis, Null, DirectDictionary
x2, MongoDB, ShellCommand, YTsaurus x3). Every one of them takes a
`SharedHeader`, so with `ISource` normalizing the header they collapse to
passing that header directly. The `createSampleBlock` comment no longer tells
callers to strip the rows themselves.

`05045_direct_dictionary_rowless_header` duplicated ClickHouse#116378's
`05043_direct_dictionary_in_merge`; its two extra arms (a `DEFAULT` on the
attribute and a plain `SELECT` from the dictionary) are folded into 05043 and
05045 is removed. With the strips gone, 05043 again fails if the `ISource`
hunk is reverted.
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-request PR origin: a maintainer pinged or directed groeneai pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.8-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical error: Expected the argument №A ('B' of type C) to have D rows, but it has E (STID: 2959-3bc4)

6 participants