Skip to content

Reject Iceberg ALTER DELETE/UPDATE on non-Parquet tables - #105893

Merged
PedroTadim merged 6 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-102508-iceberg-mutate-non-parquet
Jul 21, 2026
Merged

PedroTadim merged 6 commits into
ClickHouse:masterfrom
groeneai:groeneai/fix-102508-iceberg-mutate-non-parquet

Conversation

@groeneai

@groeneai groeneai commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #102508.

ALTER TABLE ... DELETE (and UPDATE) on Iceberg tables whose data file format is not Parquet either crashed the server (LOGICAL_ERROR "Unexpected null _row_number" on ORC; abort in AvroSerializer for some schemas) or silently corrupted the table (Avro write succeeds, all subsequent SELECTs fail with NOT_IMPLEMENTED because the read path rejects non-Parquet data files when position deletes are present).

Mutations write position-delete files using the table's write_format. The read path in IcebergDataObjectInfo::addPositionDeleteObject only accepts Parquet there, and the ORC/Avro write paths do not match that contract. PR #87277 enabled non-Parquet table formats in FileNamesGenerator without gating the mutation paths.

This PR rejects the mutation up front with NOT_IMPLEMENTED so the user gets a clear error and the table is not left in a broken state. Validation lives in a single helper Iceberg::validateMutationWriteFormat and is called from both IcebergMetadata::checkMutationIsPossible (early rejection during analysis) and Iceberg::mutate (defence in depth for any direct caller).

Parquet tables continue to work; ALTER ... ADD/DROP/MODIFY/RENAME COLUMN are unaffected (they don't depend on the data file format).

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):

Reject ALTER TABLE ... DELETE and ALTER TABLE ... UPDATE on Iceberg tables whose data file format is not Parquet with a clear NOT_IMPLEMENTED error instead of crashing the server or silently corrupting the table.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.7.1.1265 (included in 26.7 and later)

`ALTER TABLE ... DELETE` and `ALTER TABLE ... UPDATE` on Iceberg tables
whose data file format is not Parquet either aborted the server
(`Unexpected null _row_number` LOGICAL_ERROR on ORC) or silently corrupted
the table (Avro write succeeded but produced position-delete files that
the read path then rejected with `NOT_IMPLEMENTED`).

Mutations write position-delete files using the table's `write_format`.
The read side only accepts Parquet there
(`IcebergDataObjectInfo::addPositionDeleteObject`), and the ORC/Avro write
paths do not match that contract. PR ClickHouse#87277 (introducer) enabled
non-Parquet table formats in `FileNamesGenerator` without gating the
mutation paths.

Validate the format up front with a single helper
`Iceberg::validateMutationWriteFormat`. It is called from both
`IcebergMetadata::checkMutationIsPossible` (early rejection during
analysis) and `Iceberg::mutate` (defence in depth for any direct caller).
Parquet tables continue to work; `ALTER ... ADD/DROP/MODIFY/RENAME COLUMN`
are unaffected.

Closes ClickHouse#102508.
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

Session: cron:clickhouse-ci-task-worker:20260526-170000

a) Deterministic repro? Yes.

SET allow_experimental_insert_into_iceberg = 1;
CREATE TABLE t (id Int32, val String) ENGINE = IcebergLocal('/tmp/...', 'ORC')
  SETTINGS iceberg_format_version = 2;
INSERT INTO t VALUES (1, 'a'), (2, 'b');
ALTER TABLE t DELETE WHERE id = 2;
  • ORC: debug build aborts (SIGABRT) on Mutations.cpp:236 Unexpected null _row_number; release build throws LOGICAL_ERROR.
  • Avro: write succeeds, all subsequent SELECTs on the table fail with NOT_IMPLEMENTED from IcebergDataObjectInfo.cpp:100.
  • Parquet: works correctly.

b) Root cause explained? Yes.
Iceberg::writeDataFiles in Mutations.cpp calls FormatFactory::getOutputFormat(write_format, ...) for the position-delete file (line 217). For ORC, the upstream MutationsInterpreter returns _row_number as Nullable(Int64) with nulls and the explicit null-check on line 236 throws. For Avro the write completes, but the read side in IcebergDataObjectInfo::addPositionDeleteObject only accepts PARQUET (line 100), so any later read fails and the table is unusable until manual cleanup. PR #87277 enabled non-Parquet table formats in FileNamesGenerator but didn't gate the mutation paths.

c) Fix matches root cause? Yes.
A single helper Iceberg::validateMutationWriteFormat checks Poco::toUpper(write_format) == "PARQUET" (same convention as the read-side check) and throws NOT_IMPLEMENTED otherwise. Called from Iceberg::mutate (the actual writer) and from IcebergMetadata::checkMutationIsPossible (early rejection during analysis, before any state change). Not a band-aid: the error is raised at the entry to the only code path that produces the bad state.

d) Test intent preserved? / New tests added? Yes.
No existing test is removed or weakened. A new stateless test 04293_iceberg_mutate_non_parquet_reject.sh covers all three formats end-to-end:

  • ORC DELETE + UPDATE -> Code: 48 (NOT_IMPLEMENTED), table still readable.
  • Avro DELETE + UPDATE -> Code: 48, table still readable.
  • Parquet DELETE -> succeeds, expected rows.

e) Demonstrated in both directions? Yes.

  • Without the fix (git stash the three source files, rebuild): the test fails. The first ORC ALTER ... DELETE aborts the debug server, and every subsequent query in the test gets Code: 210 NetException: Connection refused. So we observe the actual crash, not just a mismatch.
  • With the fix: tests/clickhouse-test 04293_iceberg_mutate_non_parquet_reject -> 1/1 OK, and 10/10 OK with default randomized settings.

f) Fix is general, not a narrow patch? Yes.
The validation rejects the entire class of bad write formats (anything other than Parquet, case-insensitive), not just ORC or Avro. It is enforced at every entry point into the mutation pipeline through one helper, so any future direct caller of Iceberg::mutate is also covered. The fix targets where the bad state is produced (the write path's choice of format), not where it manifests (read-side null check, AvroSerializer abort).

I also considered Option B (always write position-delete files as Parquet regardless of the data file format). That is permissible per the Iceberg v2 spec, but it would touch the read path and is a larger change. Option A (this PR) closes the crash and the data-corruption window immediately; Option B can be a follow-up improvement if mixed-format support is desired.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @alesapin @scanhex12 @Michicosun could you review this? It rejects ALTER DELETE/UPDATE on Iceberg tables whose data file format is not Parquet (ORC aborts, Avro corrupts the table) with a clean NOT_IMPLEMENTED at the entry to mutate / checkMutationIsPossible.

@clickhouse-gh

clickhouse-gh Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [25f3acf]

Summary: ❌

job_name test_name status info comment
Integration tests (amd_tsan, 3/6) FAIL
test_replicated_database/test.py::test_replicated_table_structure_alter FAIL cidb, issue ISSUE EXISTS
Stress test (amd_debug) FAIL
Cannot start clickhouse-server FAIL cidb IGNORED
Check failed FAIL cidb IGNORED

AI Review

Summary

This PR closes the ORC/Avro mutation failure modes by rejecting non-Parquet Iceberg ALTER ... DELETE / UPDATE, and moving the snapshot-format validation into DB::Iceberg::mutate correctly fixes the earlier TOCTOU gap. The remaining problem is that the new validation rejects the mutation when any current-snapshot data file is non-Parquet, even if that file is in an untouched partition and can never see the new position deletes, so I cannot approve it as written.

Findings

⚠️ Majors

  • [src/Storages/ObjectStorage/DataLakes/Iceberg/Mutations.cpp:631] validateSnapshotDataFileFormatsForMutation is broader than the actual safety boundary. writeDataFiles emits position-delete files per touched partition, and IcebergIterator::defineDeletesSpan only considers delete files with the same partition spec/value before later filtering by data-file path. That means a table mounted from an external writer can safely have Avro in partition p=1 and Parquet in partition p=2; ALTER TABLE ... DELETE WHERE p = 2 should still be allowed, but this check turns it into blanket NOT_IMPLEMENTED. Suggested fix: scope the validation to the actual mutation target set, e.g. the touched _iceberg_metadata_file_paths or at least the touched partition spec/value pairs derived from the mutated rows, and reject only when one of those touched data files is non-Parquet.
Final Verdict
  • Status: ⚠️ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label May 26, 2026
@alesapin alesapin self-assigned this May 26, 2026
Address the inline review comment on PR ClickHouse#105893 by `clickhouse-gh[bot]`:
the previous validation only looked at the table's configured `write_format`,
but Iceberg permits mixed-format tables, so a table mounted with default
`Parquet` config can still contain `ORC`/`Avro` data files. In that case
`ALTER ... DELETE`/`UPDATE` would write position-delete files referencing
those non-Parquet data files, and reads then fail in
`IcebergDataObjectInfo::addPositionDeleteObject` (which requires
`info.file_format == "PARQUET"`), leaving the table unreadable.

Add a deeper per-data-file check in `IcebergMetadata::mutate` that walks
the current snapshot's manifests and throws `NOT_IMPLEMENTED` if any data
file is not Parquet. The fast configured-format check in
`checkMutationIsPossible` is kept as an early reject for the obvious case.

This also corrects the regression in `04092_iceberg_update_low_cardinality`
Test 2: that test verified an Avro `ALTER UPDATE` did not crash, but per
issue ClickHouse#102508 the previous outcome silently corrupted the table. The test
now verifies the rejection itself, which still demonstrates that the
original LowCardinality issue (ClickHouse#101916) does not crash the server.

For ClickHouse#102508.
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate (followup commit cfaf9a5):

a. Deterministic repro. The Avro ALTER UPDATE case in 04092_iceberg_update_low_cardinality.sh Test 2 reproduces the over-rejection (Code: 48 emitted by the previous patch) 100% of the time. The bot's mixed-format case is covered by the new code path that walks every data file in the current snapshot.
b. Root cause. The earlier check looked at the table's configured write_format, but Iceberg lets data files use a different format from the configured one. When write_format = Parquet and an existing data file is ORC/Avro, the mutation writes a Parquet position-delete file that references the non-Parquet data file, then reads fail in IcebergDataObjectInfo::addPositionDeleteObject (info.file_format != "PARQUET").
c. Fix matches root cause. IcebergMetadata::mutate now walks the current snapshot's manifests via getManifestFileEntriesHandle and throws NOT_IMPLEMENTED if any data file's file_format is not Parquet. This is the same field the read-side check consults, so the validation matches the actual failure condition. The configured-write_format check in checkMutationIsPossible is kept as a fast early-reject for the common non-Parquet configured case.
d. Test intent preserved. 04092_iceberg_update_low_cardinality Test 1 (Parquet UPDATE) still verifies the LowCardinality unwrap fix from #101916. Test 2 (Avro UPDATE) now verifies the rejection path, which still demonstrates that the original crash mode is gone (we no longer reach the LowCardinality code path; we reject cleanly first). 04293_iceberg_mutate_non_parquet_reject continues to cover ORC and Avro rejection and the Parquet happy path.
e. Both directions demonstrated. Without the snapshot walk (just the write_format check), a mixed-format table would pass checkMutationIsPossible, the mutation would silently produce unreadable data per issue #102508. With the walk, the mutation is rejected up front. Locally: 04092 and 04293 pass 10/10 with --test-runs 10 and random settings on a debug build.
f. General, not narrow. The fix covers both DELETE and UPDATE, both pure-non-Parquet tables (caught by either check) and mixed-format tables (caught by the snapshot walk only). The walk reuses the same field (parsed_entry->file_format) that the read-side check at IcebergDataObjectInfo::addPositionDeleteObject consults, so the validation cannot drift from the actual failure condition.

Session: cron:clickhouse-ci-task-worker:20260526-184500.

Moves the per-data-file Parquet validation from a pre-check in
IcebergMetadata::mutate into DB::Iceberg::mutate's retry loop. The
pre-check validated the snapshot at the moment it ran, but the retry
loop re-fetches metadata with force_fetch_latest_metadata = true and
writes position deletes against whatever snapshot it sees next. A
concurrent writer that committed non-Parquet data files in that
window could leave the table unreadable
(IcebergDataObjectInfo::addPositionDeleteObject rejects non-Parquet
data files). Validating after each metadata fetch closes that TOCTOU
gap and keeps the mixed-format protection.

Per the PR review at
ClickHouse#105893
groeneai added a commit to groeneai/ClickHouse that referenced this pull request May 28, 2026
This commit reverts the materialization change in
src/Processors/Transforms/FinishSortingTransform.cpp added by the
previous commit, and keeps only the documentation test under
tests/queries/0_stateless/04300_stid_3336_finishsorting_columnreplicated.sql.

The reported "Bad cast from type DB::ColumnReplicated to DB::ColumnString"
exception captured in CI on PR ClickHouse#102882, PR ClickHouse#104478, PR ClickHouse#105893 does not
reproduce deterministically on master HEAD on a debug build, so the
preceding source change was speculative and is dropped. The test stays
as a name-anchored reproducer for the query shape captured in CI.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102882&sha=1de47ad4469490e183bd76c5dad2eddd82d61422&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20WasmEdge%2C%20parallel%2C%201%2F2%29
@PedroTadim

Copy link
Copy Markdown
Member

@groeneai merge with master for one more CI run

@groeneai

groeneai commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator Author

@PedroTadim merged master in b85c34ac80df; CI rerunning.

@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Dear @alesapin, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@groeneai

groeneai commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — b85c34a

CI fully finished (Finish Workflow pass). The sole failure is the chronic arm_asan_ubsan, targeted "Server died" crash family, unrelated to this Iceberg ALTER-DELETE-reject change (which does not touch merge/serialization).

Check / test Reason Owner / fixing PR
Stateless tests (arm_asan_ubsan, targeted) / Server died crash (chronic string-size-stream / MergeTreeSequentialSource UAF family: 71 PRs, 0 master/30d — not PR-caused) #109020 (ours, in CI — the string .size subcolumn UAF fix)

Session id: cron:our-pr-ci-monitor:20260703-053000

for (const auto & file_entry : files_handle.getFilesWithoutDeleted(FileContentType::DATA))
{
const String & file_format = file_entry->parsed_entry->file_format;
if (Poco::toLower(file_format) != "parquet")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This now rejects a mutation if any file in the current snapshot is non-Parquet. That is broader than the actual safety boundary: writeDataFiles creates position-delete files per touched partition, and IcebergIterator::defineDeletesSpan only applies them to data files with the same partition spec/value. A table mounted from an external writer can legitimately have Avro in partition p=1 and Parquet in partition p=2; ALTER ... DELETE WHERE p = 2 should still be safe, but this check turns it into blanket NOT_IMPLEMENTED. The validation needs to be scoped to the files or partitions the mutation can actually touch, or the broader behavior change needs to be made explicit.

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.

Verified the mechanism: defineDeletesSpan (IcebergIterator.cpp:110-111) matches position deletes to data files by partition spec + value, so ALTER ... DELETE WHERE p = 2 on an Avro(p=1)/Parquet(p=2) table would write position deletes only against the Parquet partition and could indeed be safe. This check is intentionally broader.

It is the conservative, fail-closed boundary for the crash/corruption in #102508: rejecting the whole mutation is always safe (it can never leave the table unreadable via the read-side check in addPositionDeleteObject, IcebergDataObjectInfo.cpp:100), whereas per-partition scoping requires pruning the mutation predicate against each data file's partition spec/value and handling partition-spec evolution, which is a materially larger change.

I would prefer to land the safe reject for the crash fix here and track the per-partition narrowing as a follow-up rather than block this PR on it. I can open a follow-up issue for the narrowing.

@PedroTadim

Copy link
Copy Markdown
Member

@alesapin I think this is in good shape to be merged?

@PedroTadim PedroTadim self-assigned this Jul 17, 2026
@PedroTadim
PedroTadim enabled auto-merge July 17, 2026 17:27
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 44d6991

Every failure below has an owner: a fixing PR. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_tsan, parallel) / Logical error 'Unexpected null _row_number' (Mutations.cpp, ORC ALTER DELETE/UPDATE) crash (pre-existing trunk AST-fuzzer bug this PR fixes; build predates the fix landing on master) this PR #105893 (the fix: validateMutationWriteFormat guard)
CH Inc sync - CH Inc sync (private, not actionable)

Config Workflow, Finish Workflow green. @alexey-milovidov (on #110705) confirmed this PR covers the _row_number repro. Awaiting @PedroTadim re-review (already approved by @alesapin).

Session id: cron:our-pr-ci-monitor:20260717-193000

@clickhouse-gh

clickhouse-gh Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 86.20% 86.20% +0.00%
Functions 92.00% 92.00% +0.00%
Branches 78.20% 78.30% +0.10%

Changed lines: Changed C/C++ lines covered: 46/56 (82.14%) · Uncovered code

Full report · Diff report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 25f3acf

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
Integration tests (amd_tsan, 3/6) / test_replicated_database::test_replicated_table_structure_alter Chronic trunk flaky, not PR-caused (this PR touches only Iceberg files); 1180 fails / 527 PRs / 106 master in 30d #111029 (external, open)
Stress test (amd_debug) / Cannot start clickhouse-server Chronic trunk server-boot flaky (Code 722 async-load-failed during metadata load on stress restart), not PR-caused; 389 fails / 278 PRs / 39 master in 30d a fix task is tracking this at full effort (fixing-PR link to follow here)

Session id: cron:our-pr-ci-monitor:20260721-003000

@groeneai

Copy link
Copy Markdown
Collaborator Author

Ledger follow-up for the "Stress test (amd_debug) / Cannot start clickhouse-server" line (SHA 25f3acf; the "fixing-PR link to follow here" promised above).

Recovered inner error: Code 722 -> 695 -> load table test_3.t_plt_reparent Code 246: Part all_2_3_1_0 intersects previous part all_1_2_2_1 and the transaction metadata of at least one of them could not be read. This is the part_loading_tree_rollback poisoned-detached-table restart family (regression from #100992), not caused by this Iceberg PR (which touches only Iceberg files).

Fixing PR: #110999 (pins the 4 part_loading_tree_rollback tests to the local default storage policy; covers 04063_part_loading_tree_rollback_reparent.sh, which creates t_plt_reparent). Superseding general fix: #111055.

@PedroTadim
PedroTadim added this pull request to the merge queue Jul 21, 2026
Merged via the queue into ClickHouse:master with commit 104b5ac Jul 21, 2026
175 of 178 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 21, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Address the inline review comment on PR ClickHouse#105893 by `clickhouse-gh[bot]`:
the previous validation only looked at the table's configured `write_format`,
but Iceberg permits mixed-format tables, so a table mounted with default
`Parquet` config can still contain `ORC`/`Avro` data files. In that case
`ALTER ... DELETE`/`UPDATE` would write position-delete files referencing
those non-Parquet data files, and reads then fail in
`IcebergDataObjectInfo::addPositionDeleteObject` (which requires
`info.file_format == "PARQUET"`), leaving the table unreadable.

Add a deeper per-data-file check in `IcebergMetadata::mutate` that walks
the current snapshot's manifests and throws `NOT_IMPLEMENTED` if any data
file is not Parquet. The fast configured-format check in
`checkMutationIsPossible` is kept as an early reject for the obvious case.

This also corrects the regression in `04092_iceberg_update_low_cardinality`
Test 2: that test verified an Avro `ALTER UPDATE` did not crash, but per
issue ClickHouse#102508 the previous outcome silently corrupted the table. The test
now verifies the rejection itself, which still demonstrates that the
original LowCardinality issue (ClickHouse#101916) does not crash the server.

For ClickHouse#102508.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Moves the per-data-file Parquet validation from a pre-check in
IcebergMetadata::mutate into DB::Iceberg::mutate's retry loop. The
pre-check validated the snapshot at the moment it ran, but the retry
loop re-fetches metadata with force_fetch_latest_metadata = true and
writes position deletes against whatever snapshot it sees next. A
concurrent writer that committed non-Parquet data files in that
window could leave the table unreadable
(IcebergDataObjectInfo::addPositionDeleteObject rejects non-Parquet
data files). Validating after each metadata fetch closes that TOCTOU
gap and keeps the mixed-format protection.

Per the PR review at
ClickHouse#105893
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…8-iceberg-mutate-non-parquet

Reject Iceberg ALTER DELETE/UPDATE on non-Parquet tables
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Oct 30, 2026
`OPTIMIZE TABLE` on an Iceberg v2 table failed with

    Code: 48. DB::Exception: Position deletes are only supported for data files
    of Parquet format in Iceberg, but got ORC. (NOT_IMPLEMENTED)

on a snapshot that `SELECT` reads correctly. The carrier is a current snapshot
holding, in one partition, a non-Parquet data file whose sequence number is not
above a position delete's, where that delete references only Parquet data files.
Such a table has to be written by another engine, because ClickHouse's own
DELETE and UPDATE refuse while a non-Parquet data file is live in the current
snapshot (`validateSnapshotDataFileFormatsForMutation`).

Compaction and the read path both decide whether a position delete applies to a
data file, and compaction's decision had one term fewer. `IcebergIterator::next`
also tests the delete's `lower_reference_data_file_path` and
`upper_reference_data_file_path` against the data file's own
`data_object_file_path_key`; `getPlan` tested only the partition value and the
sequence number, so it handed a delete that provably does not name a data file to
`addPositionDeleteObject`, which rejects a non-Parquet data file. This adds that
bounds test, and only it, so the per-pair decision matches the read path's. As on
read, absent bounds mean no pruning, so a delete recording no bounds still
reports the same error a `SELECT` reports.

Results were never wrong: both delete transforms call
`filterChunkToCurrentDataFile`, so an over-attached delete could not delete
another file's rows. The change only shrinks the attachment set, and compaction's
candidate set is a superset of the read path's, so no delete the read path
applies can be lost. `writeDataFiles`' precondition still holds: a previously
over-attached non-Parquet file now takes the already-exercised no-deletes branch.

Equality deletes are unaffected. `getPlan` collects only position deletes, an
OVERWRITE snapshot carrying equality deletes is refused earlier by
`overwriteIsPositionDeleteOnly`, and `addEqualityDeleteObject` has no format
precondition.

The pass still buckets deletes by partition value without
`common_partition_specification`, so the two predicates match per pair, not as a
whole. That is left alone: data compaction resolves one default partition spec
and rewrites every manifest under it, so narrowing the bucket per spec would fix
one term of a path that then collapses all specs to one.

The regression test is an integration test because the snapshot needs an
external writer. It builds the mixed-format table with Spark and asserts the row
set is unchanged across the `OPTIMIZE`. Its arming conditions are asserted
separately, and they hold on the unfixed build, so a green run measures the fix
rather than the fixture.

Related: ClickHouse#110069, where this was reported, and ClickHouse#102508 / ClickHouse#105893, which fixed the
mutation half of the same restriction.
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 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

Development

Successfully merging this pull request may close these issues.

mutate passes non-Parquet write_format to writeDataFiles without validation, causing LOGICAL_ERROR (ORC) or SIGABRT crash (Avro)

4 participants