Skip to content

Combine small blocks into one Arrow IPC record batch on output - #119873

Merged
Avogar merged 7 commits into
ClickHouse:masterfrom
groeneai:arrow-output-record-batch-coalescing-119815
Sep 16, 2026
Merged

Avogar merged 7 commits into
ClickHouse:masterfrom
groeneai:arrow-output-record-batch-coalescing-119815

Conversation

@groeneai

@groeneai groeneai commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Closes: #119815
Related: #117754

Changelog category (leave one):

  • Improvement

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

Added output_format_arrow_record_batch_size and output_format_arrow_record_batch_size_bytes, which make the Arrow and ArrowStream output formats combine consecutive blocks that are individually smaller than the target into a single record batch. A selective SELECT produced one small record batch per scanned block, and the fixed metadata and buffer padding of each batch then dominated the payload. Both settings default to 0, which keeps the previous behavior of one record batch per block. Closes #119815.

Description

ArrowIPCBlockOutputFormat::consume wrote one record batch per incoming chunk, and nothing squashes on the SELECT ... FORMAT path: markOutputFormatPrefersLargeBlocks("ArrowStream") is consulted only on the INSERT path, through IStorage::prefersLargeBlocks. On the reported example, SELECT number FROM numbers(268435456) WHERE number % 65536 = 0 FORMAT ArrowStream produces 721,040 bytes in 4,096 one-row batches; at output_format_arrow_record_batch_size = 65409, output_format_arrow_record_batch_size_bytes = 1048576, 16,728 bytes in 1 batch, byte-identical to a hand-written single batch.

consume now stages sub-target chunks into one accumulator, and its former body moved verbatim into writeChunk. A chunk that already reaches a target flushes what is staged and is then written as it stands, so a large block is never copied or merged and a combined batch holds fewer than twice the target rows. The byte target measures the accumulated block, as min_insert_block_size_bytes does, not the encoded batch, and for a LowCardinality column the two differ by the deduplication factor in both directions; the setting documents that and points at the row target. The first chunk of a batch becomes the accumulator itself, so assembling one costs a copy less.

#117754 adds a maximum on the same seam and rewrites the body this moves into writeChunk, so either merge order rebases mechanically.

Both default to 0, where the output is byte-identical to before (cmp). Measured at 1 MiB: the repro's first batch reaches the client after 186 ms instead of 1 ms, while its total drops from 262 to 186 ms; peak memory rises by up to 7 MiB where blocks already filled a batch, the cost of the bigger batch rather than of the accumulator.

If you would rather have it on by default (65409 / 1 MiB), say so.


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

Version info

  • Backported to: 26.8.7.6, 26.7.11.7

ArrowIPCBlockOutputFormat::consume wrote exactly one record batch per incoming
chunk, and nothing squashes on the SELECT ... FORMAT path:
markOutputFormatPrefersLargeBlocks("ArrowStream") is only consulted through
IStorage::prefersLargeBlocks() on the INSERT path. A selective query therefore
emitted one small batch per scanned block, and the fixed FlatBuffers metadata
and buffer padding of each batch dominated the payload. On the reported example,
SELECT number FROM numbers(268435456) WHERE number % 65536 = 0 FORMAT
ArrowStream produced 721,040 bytes in 4,096 one-row batches; at
output_format_arrow_record_batch_size = 65409 and
output_format_arrow_record_batch_size_bytes = 1048576 it produces 16,728 bytes
in one batch, byte-identical to a hand-written single-batch encoding of the
same rows.

consume becomes a staging front end and its former body moves verbatim into
writeChunk, which is also the seam PR ClickHouse#117754 rewrites to split an oversized
chunk, so either merge order is a mechanical rebase and the two compose in the
right order: accumulate up to the target, then split what a single batch still
cannot address.

Sub-target chunks are appended into one accumulator built from
cloneEmptyColumns() rather than from the first chunk: FilterTransform passes
result_size_hint = -1, so ColumnVector::filter reserves the whole source block
and resize_exact does not release it, and adopting the first chunk would make
the accumulator carry that reservation for the lifetime of every batch. A chunk
that already reaches a target flushes what is staged and is then written
un-copied, which keeps a large block out of the accumulator and bounds a
combined batch below twice the target; gating that branch on an empty
accumulator instead would let a few staged rows absorb a 1,048,449-row INSERT
block.

The size is measured on the materialized chunk because ColumnConst::byteSize
reports one stored value, and materializeChunk is a precondition of appending
at all: MessageQueueSink drives this writer through IOutputFormat::write with
no MaterializingTransform in front of it, and appending into an accumulator
cloned from a ColumnConst would advance the row count without copying values.
The targets bound the accumulated data as Chunk::bytes() measures it, on the
same terms as min_insert_block_size_bytes, not retained memory: a
LowCardinality shared dictionary and an aggregate state's foreign arenas sit
outside that measure. Measured against blocks made equally large with
max_block_size instead, the accumulator adds between -1.0 and +1.7 MiB for a
1 MiB target.

The precedent and the refuted alternative, for the record:
output_format_parquet_row_group_size_bytes stages on the cruder
chunk.allocatedBytes() (ParquetBlockOutputFormat.cpp:121) and under-counts
LowCardinality the same way, because byteSize() counts the deduplicated
dictionary once while the encoder writes one value per row unless
output_format_arrow_low_cardinality_as_dictionary is set. Summing each incoming
chunk's bytes as Squashing does was rejected, not overlooked:
ColumnLowCardinality::filter keeps the whole source dictionary and filters only
the indexes (ColumnLowCardinality.h:126-130), so over the 4,096 one-row chunks
this change exists to combine, that sum over-counts by about the chunk count and
would flush at the first one. The byte setting's description states the measure
and advises pairing it with the row criterion.

Both settings default to 0, which is byte-identical to the previous behaviour,
and SettingsChangesHistory records 0 -> 0 so compatibility below 26.9 keeps it.

Closes: ClickHouse#119815

Co-Authored-By: Claude Opus 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 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review

An independent cold review plus a second model reviewed this change over two rounds before it was
published. Verdicts are mine; findings I disagreed with are recorded with the evidence that refuted them.

❌ Fixed: the byte target published a bound it did not deliver for LowCardinality.
ColumnLowCardinality::byteSize deliberately does not count what the encoder expands (it counts the
deduplicated dictionary plus the indexes, and skips a shared dictionary entirely), while
RecordBatchEncoder writes such a column expanded whenever
output_format_arrow_low_cardinality_as_dictionary = 0. Measured: a 1500-byte target over repeated
1000-byte strings ended batches after 484 rows holding about 484 KiB of values, against two-row
batches for the equivalent plain String. With the byte criterion set alone the batch is unbounded in
rows. The measure is unchanged, deliberately: it is the same measure as min_insert_block_size_bytes,
and output_format_parquet_row_group_size_bytes uses a cruder one with the same property. What
changed is the contract: the setting now documents the measure and the consequence, tells the user to
pair it with the row criterion to bound the batch, and two test arms pin both halves.

⚠️ Disagreed: track cumulative incoming chunk bytes instead, as Squashing does.
ColumnLowCardinality::filter keeps the whole source dictionary and filters only the indexes, so
every one-row chunk of a filtered LowCardinality column carries its source dictionary. Summing
per-chunk bytes over the 4,096 chunks of the reported query over-counts by about that factor and
flushes at the first chunk, which makes the feature inert on exactly the query it exists to fix; and a
shared dictionary is excluded per chunk as well, so it does not fix the reported case either.

⚠️ Disagreed: account for the representation passed to the encoder. Exact accounting needs a
per-row walk or an estimate, on a knob whose siblings all measure block bytes. Rejected as scope
creep; the precedent is recorded in the commit message.

⚠️ Disagreed: the plan's peak-memory rule should have forced a redesign. The rule's denominator
conflated the cost of encoding a bigger batch with the cost of the accumulator. Against a control
producing the same batch sizes through max_block_size instead, the accumulator adds between -1.0 and
+1.7 MiB for a 1 MiB target, negative for LowCardinality. The user-visible rise is in the PR
description.

💡 Noted, not blocking: the byte setting's wording covers the private-dictionary case only. Both
the cold review and the second model raised this in the final round, and I agree with it. The setting
says a LowCardinality column "counts its deduplicated dictionary once";
ColumnLowCardinality::byteSize excludes that dictionary entirely when it is shared, and an empty
accumulator adopts a structurally compatible shared source dictionary, which is the usual shape for a
column deserialized from a part. The measure is then one index byte per row, so the gap the sentence
warns about is larger than it says rather than smaller, and both the warning and the advice to pair the
byte target with the row target hold either way. If you want the sentence exact, this is the wording I
would push: "a LowCardinality column counts its dictionary once, or not at all when that dictionary
is shared with the blocks it came from".

💡 Noted, not blocking. The dictionary-delta and Arrow-file arms were strengthened to produce
several coalesced batches, so a delta emitted from a merged dictionary and a multi-entry file footer
are both pinned. FormatSettings::arrow::row_group_size is dead across src/ (a leftover of the
removed Apache Arrow library writer) and is deliberately left alone, so as not to collide with
#107897.

@clickhouse-gh clickhouse-gh Bot closed this Sep 14, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b54c79b]

Summary: ❌

job_name test_name status info comment
Build profile diff ERROR

AI Review

Summary

This PR adds output_format_arrow_record_batch_size and output_format_arrow_record_batch_size_bytes so Arrow/ArrowStream can coalesce undersized output chunks into larger record batches. The main ArrowIPC staging path looks sound for ordinary columnar results, but there is still one user-visible shape where the new contract does not hold: zero-column chunks are forced to bypass coalescing entirely.

Findings

⚠️ Majors

  • [src/Processors/Formats/Impl/ArrowIPC/ArrowIPCBlockOutputFormat.cpp:380] The new settings promise that consecutive blocks smaller than the target are combined, but this branch exempts every zero-column chunk from that behavior. Chunk explicitly supports 0 columns with a non-zero row count, so a query that projects everything away (for example SELECT * EXCEPT (x) on a one-column source) can still emit one Arrow record batch per scanned block even when both new coalescing settings are enabled. Please stage the row count for zero-column chunks as well, instead of always flushing them immediately, and add a focused regression test for a zero-column Arrow/ArrowStream result.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions: make zero-column chunks participate in the new coalescing logic, and cover that result shape with a focused regression test.

LLVM Coverage Report

Measured on commit b54c79b.

Metric Baseline Current Δ
Lines 88.40% 88.40% +0.00%
Functions 91.80% 91.70% -0.10%
Branches 80.50% 80.50% +0.00%

Changed lines: Changed C/C++ lines covered: 78/79 (98.73%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Sep 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, one command, byte-exact and not statistical: clickhouse local --query "SELECT number FROM numbers(268435456) WHERE number % 65536 = 0 FORMAT ArrowStream" gives 721,040 bytes in 4,096 one-row record batches, which is the reporter's figure exactly.
b Root cause explained? ArrowIPCBlockOutputFormat::consume wrote exactly one record batch per incoming chunk, and nothing squashes on the SELECT ... FORMAT path: markOutputFormatPrefersLargeBlocks("ArrowStream") is consulted only through IStorage::prefersLargeBlocks on the INSERT path. A filtering query therefore emitted one small batch per scanned block, and per-batch metadata plus buffer padding dominated the payload.
c Fix matches root cause? The batch boundary is now decided where it is made, in consume. No widened bound, no reduced dataset, no defensive check masking an upstream problem.
d Test intent preserved / new tests added? No existing test changed: with both settings at 0 nothing in the suite changes behaviour. New test 05211_arrow_output_record_batch_coalescing.sh, 15 arms, each asserting an exact batch count plus the rows read back.
e Both directions demonstrated? Enabled: 16,728 bytes in 1 batch, cmp-identical to a single-batch encoding of the same rows. Default: cmp-identical to the unpatched binary's output. The new test fails on the unpatched binary (Unknown setting) and passes on the patched one. 50/50 runs green.
f Fix is general across code paths? Both registrations (Arrow file and ArrowStream) share this writer and both are covered, including the file footer via ipc.open_file. The sibling output-side squashing sites (ParquetBlockOutputFormat::consume, PrettyBlockOutputFormat) already have their own targets and are untouched. CHColumnToArrowColumn, which the ArrowFlight endpoint uses, is not this writer: 120 test_arrowflight_interface tests confirm it.
g Fix generalizes across inputs (params/datatypes/wrappers)? Arms cover UInt64, a constant expression, LowCardinality(String) plain and dictionary-encoded, Nullable(UInt64), a 0-row result, a chunk that alone reaches the target, one that exactly equals it (a >=/> mutant reddens that arm), a 0-column chunk, dictionary deltas across several combined batches, and the row and byte criteria alone and together, including the byte criterion alone over a repeated LowCardinality value, whose documented deduplicated measure the arm pins against the same values as a plain String.
h Backward compatible? Both settings default to 0 and the output is byte-identical to master by cmp. Two SettingsChangesHistory rows in the 26.9 block record 0 -> 0, so compatibility below 26.9 keeps today's behaviour. No format, protocol or schema change; Arrow IPC readers are batch-agnostic by specification.
i Invariants and contracts preserved? Every consumed row appears exactly once, in order, in some emitted batch. finalizeImpl drains the accumulator before EOS/footer, resetFormatterImpl clears it so rows cannot leak across the write/finalize/reset reuse that MessageQueueSink performs (test_storage_kafka test_block_based_formats_2 passes), the accumulator is only appended to, the schema still precedes the first batch, and a chunk that reaches a target flushes what is staged rather than absorbing it, so a batch this change creates stays below twice the target. Each of those is pinned by a mutant that reddens the suite.

Session id: cron:clickhouse-impl-slot-5:20260913-232400

@clickhouse-gh clickhouse-gh Bot added the comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). label Sep 14, 2026
`ColumnLowCardinality::byteSize` counts one index per row plus each distinct
value once, and nothing at all for the values while the dictionary is still
shared with the block the column came from (ColumnLowCardinality.h:196-197, and
the empty-plus-shared adoption at ColumnLowCardinality.cpp:245-250). That has
two consequences for `output_format_arrow_record_batch_size_bytes` and only one
of them was documented:

- a batch of repeated values encodes to more than the target, because the record
  batch writes one value per row;
- a block filtered out of a larger one keeps that block's dictionary, so it can
  reach the target on its own. Measured on a four-block fixture with one
  surviving row per block: the byte target ends every batch at that single row
  and combines nothing, and since whichever target is reached first ends a
  batch, it also ends the batches a paired row target would have combined.

This is the accounting of `min_insert_block_size_bytes`, which the setting
documents itself against: `Squashing::oneMinReached` uses the same
`Chunk::bytes` measure, the same per-chunk pre-check and the same disjunction of
the two criteria (Squashing.cpp:395-411), and it produces identical block counts
on that fixture in all three configurations. The behaviour is therefore
unchanged; the setting now states what it counts, and 05211 pins both halves
with a `String` control and the row-target remedy beside them.

The `staged` comment no longer claims the accumulator holds none of the source
block's allocations, which the shared-dictionary path would falsify.
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing commit b54c79b980f27a2f7cab435976ca51fd8c5ef518 with master failed: RuntimeError: CI logs cluster query failed: SELECT count() AS c FROM binary_sizes W….

See the job log for details.

@Avogar Avogar self-assigned this Sep 14, 2026
Comment on lines +388 to +392
if (!staged.getNumRows())
/// Empty columns rather than the chunk itself: a filtered column keeps the capacity reserved for
/// its whole source block, which the accumulator would then hold for the lifetime of every batch.
staged.setColumns(chunk.cloneEmptyColumns(), 0);
staged.append(chunk);

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.

Why not just staged = std::move(chunk) when the accumulator is empty, and staged.append(chunk) otherwise? Neither reason in the comment seems to justify copying the first chunk of every batch. The capacity a filtered column retains is one source block's worth, and Chunk::bytes sums byteSize, not allocatedBytes, so it never affects the flush criterion. And where an inherited size does end a batch early, the result is one record batch per block, which is the previous behaviour and exactly what the early-out above already accepts for a LowCardinality block keeping its source dictionary. Cloning empty does not reliably prune that dictionary either: ColumnLowCardinality::insertRangeFrom adopts the source dictionary wholesale when the target is empty and the source dictionary is shared and structurally compatible, which is the usual case for a column read from storage, so the accumulator ends up holding the same bytes a moved-in chunk would. Moving instead drops a full copy of the first chunk, which is up to half the copied volume when blocks sit just under the target, plus that chunk's per-row dictionary remap. It looks safe: Chunk::append goes through mutateColumns, which clones only a genuinely shared column, and insertRangeFrom calls compactIfSharedDictionary before mutating a shared dictionary.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Adopted in 8483e2a: staged = std::move(chunk) on the empty path, staged.append(chunk) otherwise, and both stated reasons are out of the comment.

Your two refutations hold by measurement, not only by reading:

  • Output unchanged. 18 fixtures (both targets, dictionary-encoded output, filtered / nested / nullable LowCardinality, a table-backed Wide part written with one dictionary for the whole part, and the Arrow file footer) produce byte-identical payloads with identical batch boundaries before and after.
  • An inherited size does not move the criterion. Worst case I could build for the retained reservation: 8 blocks of 8192 rows x 10 KB, materialized and then filtered to one surviving row each, with a row target no accumulation reaches, so the first surviving chunk is held for the whole query. Peak RSS 344,988 KiB before vs 345,160 KiB after, and the max_memory_usage threshold is the same on both (each completes at 100 MiB and each throws Code: 241 at 80 MiB).
  • No write-through. Checked on the reachable shape where the producer keeps the columns, a Memory table whose source hands the chunk the stored block's own columns: contents unchanged after its rows are dumped as one combined batch, and a second dump byte-identical to the first.

What it buys, on the shape where the dropped copy is a per-row dictionary remap rather than a memcpy (high-cardinality LowCardinality(String), blocks one row under the row target, 4M rows): 0.38 s against 0.43 s wall and 0.39 s against 0.46 s CPU, best of 7 alternating runs, debug build. On a wide String result the difference is below the noise floor, the copy there being a bulk memcpy next to the constant expansion and the encode.

The matching sentence in the description is updated as well.

`consume` cloned empty columns and appended the first chunk of every batch into
them; it now takes that chunk itself and appends only the chunks that follow.
Neither reason for the copy holds: the capacity a filtered column retains is one
source block's worth, and `Chunk::bytes` sums `byteSize`, not `allocatedBytes`,
so it never reaches the flush criterion; where an inherited size does end a batch
early, the result is one record batch per block, which is the previous behaviour
and what the early-out above already accepts for a `LowCardinality` block keeping
its source dictionary.

The output is unchanged. 18 fixtures covering both targets, the dictionary-encoded
path, filtered, nested and table-backed `LowCardinality` (including a wide part
written with one dictionary for the whole part) and the `Arrow` file footer produce
byte-identical payloads before and after, with the same batch boundaries.

Appending into the adopted chunk cannot write through to another holder, because
`Chunk::append` mutates through `IColumn::mutate`, which clones a column that is
still shared. Checked on the reachable shape rather than by reading: a `Memory`
table, whose source hands the chunk the stored block's own columns, is unchanged
after its rows are dumped as one combined batch, and a second dump is identical
to the first.

On a high-cardinality `LowCardinality(String)` result with blocks one row under
the row target, where the dropped copy is a per-row dictionary remap rather than
a memcpy, 4M rows take 0.38 s instead of 0.43 s (best of 7 alternating runs,
debug build). On a wide `String` result the difference is below the noise floor.
Comment thread src/Core/FormatFactorySettings.h Resolved
@EmeraldShift

Copy link
Copy Markdown
Contributor

I’ve cleaned up the setting docs and added the streaming/memory caveat in this commit. Could you cherry-pick it into this branch? Documentation only; no behavior changes.

@EmeraldShift

Copy link
Copy Markdown
Contributor

@groeneai see my comment above and also resolve conflicts with master

groeneai and others added 3 commits September 14, 2026 19:49
Describe buffering, streaming latency, and `LowCardinality` size caveats.

Carried over unchanged from EmeraldShift/ClickHouse@88d7dbf,
requested in ClickHouse#119873 (comment).
Every statement was checked against the shipped behaviour before carrying it.

Co-authored-by: Michael Jarrett <[email protected]>
The repository asks for `f` rather than `f()` where the text names a function
itself instead of applying it (.claude/CLAUDE.md). `numbers`, `numbers_mt` and
`ColumnLowCardinality::byteSize` are named, not called, in these three comments.

Co-Authored-By: Claude Opus 5 <[email protected]>
…-batch-coalescing-119815

# Conflicts:
#	src/Core/SettingsChangesHistory.cpp
@groeneai

Copy link
Copy Markdown
Collaborator Author

Both done, in 3faa2b6.

Your docs commit is carried over in 643fbdf with the wording unchanged, and with you as co-author (my push path requires commits under my own identity). I checked each new statement against the shipped behaviour before carrying it, and the streaming caveat holds as written: with a row target of 1000000 and six one-row blocks, the ArrowStream output sits at 136 bytes (the schema message alone) for the whole query and only reaches 360 bytes when the query finishes, carrying one record batch for all six blocks.

Master is merged in 3faa2b6. The only conflict was SettingsChangesHistory.cpp, where both sides had appended to the 26.9 block, so both sets of entries are kept; the PR is mergeable again and CI is running on the new head.

@EmeraldShift

EmeraldShift commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

@Avogar or @tavplubix, any chance this PR can be backported to stable or LTS releases? It's a rather nice fix for some bad performance regression when we switched to using _part_offset-based projection indexes, because those produce tons of very small (1-2 row) record batches.

@Avogar

Avogar commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

any chance this PR can be backported to stable or LTS releases?

I am ok to nackport it, it's a small isolated change, the only complication is backporting settings, but I will take care of it.

@Avogar Avogar added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Sep 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 3faa2b6

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
AST fuzzer (amd_debug, targeted) / Server unresponsive: memory limit exceeded unbounded {a,b,c} glob expansion in a fuzzed file() path exhausts the cap the server derives for itself (40.37 GiB RSS vs 40.33 GiB, graceful Code: 241; expandSelectionGlob / expandSelectorGlobImpl frames in server.log, and the last fuzzed query carries four brace groups). Not reachable from this diff: the memory goes in path expansion, before any format is constructed, and the Arrow here is the read side. 34 unrelated PRs and 4 master runs in 30 days #118467 (external, open)
Build profile diff a CI logs cluster read of build_time_trace fails and the job treats that as fatal, printing its own SQL instead of the cluster's error (47 error heads across 44 PRs in the last 3 days) #118708 (ours, open)

PR is the workflow rollup of the two rows above, not a separate failure. CH Inc sync passed on this head, so there is no exempt row.

Session id: cron:our-pr-ci-monitor:20260915-013207

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - b54c79b

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.

CI is fully finished on this head: 176 checks, 153 pass, 20 skipped, 2 failed,
aggregator complete, and nothing left running except CH Inc sync. The last real check completed at
18:03:15Z, well past the 20 minute buffer the CI database needs.

Check / test Reason Owner / fixing PR
Build profile diff infra, nothing tested: has_pr_data raised RuntimeError: CI logs cluster query failed on the binary_sizes read and aborted the job before any comparison ran #120121 (mine, open), which turns a transient cluster read failure into a skipped comparison instead of a failed one
CH Inc sync still pending: the private mirror sync does not complete on a fork CH Inc sync (private, not actionable by me)

PR aggregate the rows above rather than adding a failure of their own.

Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119873&sha=b54c79b980f27a2f7cab435976ca51fd8c5ef518&name_0=PR

Session id: cron:our-pr-ci-monitor:20260915-190256

@Avogar

Avogar commented Sep 16, 2026

Copy link
Copy Markdown
Member

It will be hard to backport to 26.3 and 26.6 because there is no Arrow IPC writer there, and it will require porting this ris to the legacy Arrow writer, which I don't want to do.

@EmeraldShift

Copy link
Copy Markdown
Contributor

26.7+ is perfectly fine -- we run 26.7 for the cluster most impacted by this change.

Avogar added a commit that referenced this pull request Sep 16, 2026
The only conflict is `src/Core/SettingsChangesHistory.cpp`: master records
the two new settings under `26.9`, a block that does not exist on this
release branch. Drop the incoming block and record

    output_format_arrow_record_batch_size
    output_format_arrow_record_batch_size_bytes

under `26.8` instead, the branch's current version block, which is what
`check_settings_changes_history` in ci/jobs/check_style.py requires.

Everything else applies unchanged: the resulting diff against the release
branch is the original change, entry for entry.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Avogar added a commit that referenced this pull request Sep 16, 2026
…onflicts

`src/Core/FormatFactorySettings.h`, `src/Formats/FormatFactory.cpp` and
`src/Formats/FormatSettings.h`: both sides add lines at the same place.
Keep both - 26.7 still selects between the two Arrow writers through
`input_format_arrow_use_native_reader` and
`output_format_arrow_use_native_writer`, which master has since removed.

`src/Processors/Formats/Impl/ArrowIPC/ArrowIPCBlockInputFormat.cpp`: take
the release branch's version. 26.7 does not yet embed the format
documentation in the source, so the two rows the change adds to the
`Arrow` and `ArrowStream` settings tables have nowhere to go.

`src/Core/SettingsChangesHistory.cpp`: master records the two new settings
under `26.9`, a block that does not exist here. Drop the incoming block and
record them under `26.7`, the branch's current version block, which is what
`check_settings_changes_history` in ci/jobs/check_style.py requires.

The writer itself applies unchanged. Note that the record batch targets
only take effect with the native writer, so they are ignored when
`output_format_arrow_use_native_writer = 0`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
robot-ch-test-poll3 added a commit that referenced this pull request Sep 16, 2026
Cherry pick #119873 to 26.7: Combine small blocks into one Arrow IPC record batch on output
robot-clickhouse added a commit that referenced this pull request Sep 16, 2026
robot-ch-test-poll3 added a commit that referenced this pull request Sep 16, 2026
Cherry pick #119873 to 26.8: Combine small blocks into one Arrow IPC record batch on output
robot-clickhouse added a commit that referenced this pull request Sep 16, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 16, 2026
PedroTadim added a commit that referenced this pull request Sep 17, 2026
Backport #119873 to 26.7: Combine small blocks into one Arrow IPC record batch on output
PedroTadim added a commit that referenced this pull request Sep 17, 2026
Backport #119873 to 26.8: Combine small blocks into one Arrow IPC record batch on output
@alexey-milovidov alexey-milovidov mentioned this pull request Sep 23, 2026
1 task done
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-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). 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-improvement Pull request with some product improvements pr-must-backport Pull request should be backported intentionally. Use this label with great care! 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArrowStream emits thousands of tiny record batches, adding substantial decoding overhead

6 participants