Skip to content

Antalya 26.6: Added support for alter add column with first/after - #2289

Open
subkanthi wants to merge 10 commits into
antalya-26.6from
2091-support-firstafter-keywords-for-alter-table-modify-column-in-iceberg-tables
Open

subkanthi wants to merge 10 commits into
antalya-26.6from
2091-support-firstafter-keywords-for-alter-table-modify-column-in-iceberg-tables

Conversation

@subkanthi

@subkanthi subkanthi commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

closes: #2091

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

Added support for the FIRST and AFTER clauses with ALTER TABLE ADD COLUMN and ALTER TABLE MODIFY COLUMN for Iceberg tables (DataLakeCatalog).

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

@subkanthi subkanthi changed the title Added support for adlter add column with first/last Added support for alter add column with first/last Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [4d61da5]

@subkanthi subkanthi changed the title Added support for alter add column with first/last Antalya 26.6: Added support for alter add column with first/last Aug 28, 2026
@subkanthi
subkanthi marked this pull request as ready for review August 31, 2026 20:10
@subkanthi

Copy link
Copy Markdown
Collaborator Author
 set allow_insert_into_iceberg=1;

SET allow_insert_into_iceberg = 1

Query id: a24c0e73-e0cb-4a2b-9f38-a003b769a98e

Ok.

0 rows in set. Elapsed: 0.007 sec. 

Ubuntu-2404-noble-amd64-base :) alter table ice.`flowers.sample` add column value1 Nullable(Int64) first;

ALTER TABLE ice.`flowers.sample`
    (ADD COLUMN `value1` Nullable(Int64) FIRST )

Query id: a83c2a54-6343-4114-a876-655889a30e9e

Ok.

0 rows in set. Elapsed: 0.182 sec. 

Ubuntu-2404-noble-amd64-base :) show create table ice.`flowers.sample`;

SHOW CREATE TABLE ice.`flowers.sample`

Query id: 0e533740-a3f7-435e-bfa8-b0fddfaae688

   ┌─statement─────────────────────────────────────────────────────────┐
1. │ CREATE TABLE ice.`flowers.sample`                                ↴│
   │↳(                                                                ↴│
   │↳    `value1` Nullable(Int64),                                    ↴│
   │↳    `value` Nullable(Int64),                                     ↴│
   │↳    `boolean_col` Nullable(Bool),                                ↴│
   │↳    `dec_col_2` Nullable(Decimal(10, 2)),                        ↴│
   │↳    `value2` Nullable(Int64),                                    ↴│
   │↳    `value3` Nullable(Int64)                                     ↴│
   │↳)                                                                ↴│
   │↳ENGINE = Iceberg('http://localhost:9000/bucket1/flowers/sample/') │
   └───────────────────────────────────────────────────────────────────┘

1 row in set. Elapsed: 0.017 sec. 

@subkanthi subkanthi changed the title Antalya 26.6: Added support for alter add column with first/last Antalya 26.6: Added support for alter add column with first Aug 31, 2026
@subkanthi

Copy link
Copy Markdown
Collaborator Author
alter table ice.`flowers.sample` modify column value2 Nullable(Int64) first;

ALTER TABLE ice.`flowers.sample`
    (MODIFY COLUMN `value2` Nullable(Int64) FIRST )

Query id: a96ecd40-d7c7-4e4d-b6b9-1a62453b4418

Connecting to database ice at localhost:9008 as user default.
Connected to ClickHouse server version 26.6.2.

Ok.

0 rows in set. Elapsed: 0.258 sec. 

Ubuntu-2404-noble-amd64-base :) show create table ice.`flowers.sample`;

SHOW CREATE TABLE ice.`flowers.sample`

Query id: 901ee53f-8b02-4b95-b4d7-e2de4a8992f1

   ┌─statement─────────────────────────────────────────────────────────┐
1. │ CREATE TABLE ice.`flowers.sample`                                ↴│
   │↳(                                                                ↴│
   │↳    `value2` Nullable(Int64),                                    ↴│
   │↳    `value1` Nullable(Int64),                                    ↴│
   │↳    `value` Nullable(Int64),                                     ↴│
   │↳    `boolean_col` Nullable(Bool),                                ↴│
   │↳    `dec_col_2` Nullable(Decimal(10, 2)),                        ↴│
   │↳    `value11` Nullable(Int64),                                   ↴│
   │↳    `value3` Nullable(Int64),                                    ↴│
   │↳    `value6` Nullable(Int64)                                     ↴│
   │↳)                                                                ↴│
   │↳ENGINE = Iceberg('http://localhost:9000/bucket1/flowers/sample/') │
   └───────────────────────────────────────────────────────────────────┘

1 row in set. Elapsed: 0.013 sec. 

…-column-in-iceberg-tables' of https://github.com/Altinity/ClickHouse into 2091-support-firstafter-keywords-for-alter-table-modify-column-in-iceberg-tables
@DimensionWieldr

Copy link
Copy Markdown
Collaborator

CI triage

Not caused by this PR. Iceberg FIRST/AFTER tests passed (test_writes_modify_column_position.py, Iceberg regression, unit tests). Run 33461281948 / SHA d9e23e0e.

Category What
This PR none
Pre-existing flaky test_concurrent_create_drop_race_condition (timeout; 26 fails / 9 PRs upstream); 00661_optimize_final…, 01055_compact_parts (0 fails on diagnosis); 02265_column_ttl (CAS S3 Code 210)
Infrastructure asan session-timeout (3/8: 496 passed, 0 failed); Spark iceberg cluster Connection refused (schema_inference); fake GCS UNCERTAIN (test_cas_gcs); tiered_storage docker teardown hang; 5h cancelled CAS jobs; empty 10‑min GitHub placeholders
Unrelated (test suite) settings snapshot missing export_merge_tree_part_ignore_extra_source_columns / export_merge_tree_part_schema_match_mode after #2220 — will fail every antalya-26.6 PR until the 26.6_antalya snapshot is updated

Approve from a #2289 perspective. Optional: rerun integration 3/8 and 4/8; fix settings snapshots in clickhouse-regression separately.

@DimensionWieldr

Copy link
Copy Markdown
Collaborator

Tests in Altinity/clickhouse-regression@a7fcec8 for FIRST / AFTER are passing on Glue and Ice rest catalogs.

LGTM

@DimensionWieldr DimensionWieldr added enhancement New feature or request verified Approved for release antalya-26.6 labels Sep 2, 2026
@subkanthi subkanthi changed the title Antalya 26.6: Added support for alter add column with first Antalya 26.6: Added support for alter add column with first/after Sep 3, 2026
@blau-ai blau-ai mentioned this pull request Sep 3, 2026
29 tasks
@DimensionWieldr DimensionWieldr removed the verified Approved for release label Sep 22, 2026
@DimensionWieldr

DimensionWieldr commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Build (amd_debug) and Build (amd_asan_ubsan) both fail compiling gtest_iceberg_metadata_generator.cpp. Calls with only a name and a type are ambiguous:

error: call to member function 'generateAddColumnMetadata' is ambiguous
    gen.generateAddColumnMetadata("z", makeNullable(std::make_shared<DataTypeInt64>()));

Same error at lines 140, 234, 251, and 264. MetadataGenerator.h now declares both of these:

void generateAddColumnMetadata(const String & column_name, DataTypePtr type, bool first = false, const String & after_column = {});
void generateAddColumnMetadata(const String & column_name, DataTypePtr type);

The new overload's default arguments make a two-argument call match the old declaration as well. The .cpp definition was rewritten to the four-argument signature, so the old declaration has no body either.

@subkanthi Maybe drop the two-argument declaration and keep the one with the defaults? The existing tests then resolve to that function. The other builds on this run passed because they do not compile unit_tests_dbms.

@DimensionWieldr

Copy link
Copy Markdown
Collaborator

PR #2289 CI Triage

Run 35752871749, 3b72ad5487. The earlier compile failure is gone: Build (amd_debug) and Build (amd_asan_ubsan) are green after the duplicate generateAddColumnMetadata declaration was removed.

Summary

Category Count What
regression 0 —
infrastructure 7 submodule clone, Grype CVE, CAS contention, fuzzer SIGSEGV, two stress jobs
pre-existing-flaky 1 named-collections race timeout
cascade parents of the rows below suite wrappers, and Check failed after the asan stress server did not stay up
unknown 4 three lightweight-delete counts, one settings snapshot

Nothing in the remaining list matches this diff (Iceberg ADD/MODIFY FIRST/AFTER).

Infrastructure

  • Source upload. git submodule clone failed: could not read Username for 'https://github.com'.
  • Grype, keeper and server alpine. Both fail on CVE-2026-85091 (High) in Alpine zlib 1.3.2. The Ubuntu server image passed. Base-image CVE, not this change.
  • CAS jobs. Same family of Code 210:
    • cas_alter_attach_3: CAS write could not be committed (ref catalog deadline, then checkpoint contention).
    • cas_selects: content-addressed disk 'cas_disk' -- mount lease not held (TRANSIENT unavailability).
    • 02346_text_index_bug108874: CAS checkpoint contention. The harness reran with the same settings, 4/4 passed.
    • Stress (amd_debug, cas s3 storage): Server died / lost connection. fatal.log is empty, no OOM, and the non-CAS debug stress job on this SHA passed.
    • Stress (amd_asan_ubsan, cas s3 storage): Cannot start clickhouse-server after connection refused. Check failed is the exit of that. The non-CAS asan stress job passed.
  • AST fuzzer (amd_debug, targeted, old_compatibility). The debug binary SIGSEGV on clickhouse --query "SELECT 1" while printing Decompressing the binary. No stack. The other debug fuzzer jobs on this SHA finished normally.

Pre-existing flaky

  • test_named_collections/test.py::test_concurrent_create_drop_race_condition: pytest timeout at 900s. Upstream over 60 days: 37 fails in 104,289 runs (0.04%). This PR: 1 of 1. The diff does not touch named collections.

Unknown

These block a clean approval until the branch rate is checked. None of them is exercised by this diff.

  • Lightweight delete, one run each, concurrent row counts: random delete 75 percent of the table got 251 vs 250; random delete 25 percent of the table without overlap (s3 cache) got 762 vs 750; random delete entire table without overlap got 2 vs 0. Parent suite rows are cascade.
  • /settings/default values/iceberg_manifest_min_count_to_compact: SnapshotNotFoundError. The server returned '{"default":"30"}'. That line exists in default values>=26.8.snapshot and is absent from default values>=26.6_antalya.snapshot. This PR does not touch those files. One antalya-26.6 settings run would show whether the branch already fails the same way.

cas_s3_cache_selects was cancelled after 3h 30m in the run step. No report was uploaded.

…-alter-table-modify-column-in-iceberg-tables
@DimensionWieldr

DimensionWieldr commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Run 35915202409 on 4d61da54 (merge from antalya-26.6). Builds are green, unit tests passed, and the earlier transient failures came back green. Nothing still red matches the Iceberg FIRST/AFTER change.

The remaining red checks are outside this PR:

  • Grype (keeper and alpine server): CVE-2026-85091 in Alpine zlib 1.3.2. The Ubuntu server image passed.
  • settings: missing snapshot line for iceberg_manifest_min_count_to_compact in default values>=26.6_antalya.snapshot. The server returns default 30, which is already in the 26.8 snapshot.
  • Source upload: submodule clone failed again with could not read Username for 'https://github.com'.
  • cas_selects: cas_disk mount lease not held (Code 210).
  • cas_lightweight_delete_4: concurrent delete counted 252 rows vs 250. The s3-cache shard passed.
  • clickhouse_keeper_failover: could not bring up docker-compose cluster.
  • rbac_3: the run step died after about 19 minutes. Shards 1 and 2 passed. No report was uploaded.
  • Stateless 02421_truncate_isolation_no_merges and 04053_arrow_view: failed once, then passed on the in-job rerun.

LGTM, just waiting on dev review process

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support FIRST/AFTER keywords for ALTER TABLE MODIFY COLUMN in Iceberg tables

3 participants