Repository navigation
Run the performance tests on Iceberg tables - #128261
Merged
Merged
Conversation
Add an Iceberg configuration of the performance comparison: `perf.py --table-engine iceberg_local|iceberg_s3` creates the plain `MergeTree` tables of a test as `IcebergLocal` or `IcebergS3` tables, so that the same queries measure the Iceberg read and write path. The rewrite is in `tests/performance/scripts/iceberg_engine.py`: it formats each `CREATE TABLE` with `clickhouse format --oneline`, replaces the engine, keeps the leading plain `ORDER BY` columns as the sort order, drops the clauses Iceberg has no equivalent for and widens the column types it cannot store. A table that cannot be converted without changing what the test measures is an error. The configuration runs the 208 tests with a plain `MergeTree` table in a `create_query`, except `long` tests, `<test iceberg="0">` and `tests/performance/iceberg_skip_list.txt` (73 tests, each with its reason, from a local sweep of every test on a master build). It runs in pull requests that change the Iceberg, object storage or Parquet code or the harness (`ci-performance` runs it always), not as a gate, and every night in the new `NightlyIcebergPerformance` workflow, which reuses the binary and reference resolution of `NightlyExtendedPerformance`. The uploaded rows carry `arch = 'arm_iceberg_local'` or `'arm_iceberg_s3'`, because the performance tables and the dashboard filters have no column for the job: the history, learned thresholds and dashboard gate of the MergeTree runs do not read them, and this configuration uses none of them.
Contributor
|
Workflow [PR], commit [6f6e4e3] Summary: ✅
AI ReviewSummaryThe PR adds Final VerdictStatus: ✅ Approve |
Every test the Iceberg configuration selects was run on a master build with the rewrite of `iceberg_engine.py`. The four partition tests run now that `PARTITION BY` is dropped instead of translated; three more tests need an Iceberg feature that is missing (`ALTER ... STATISTICS`, lightweight `UPDATE`, `UInt64` in `CREATE ... AS SELECT`).
praktika runs the jobs with `PYTHONSAFEPATH=1`, so the directory of the script is not on `sys.path` and every test of the Iceberg configuration failed with `ModuleNotFoundError: No module named 'iceberg_engine'`. https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/a531824901e8bfeeded71b87cb63f89185114873/pr/performance_comparison_arm_release_master_head_iceberg_local_1_2/report.html #128261
The first complete CI run of the configuration failed these tests the same way on both backends: `CREATE TABLE ... AS hits_10m_single` copies `UInt64` columns (the local sweep had no `hits` datasets), assertions on MergeTree parts or on the CPU slots of a MergeTree read, `timeSeriesIdToGroup` over ids written to Iceberg, and `TRUNCATE`, which data lake engines do not support. https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/bb2a0796d01a4c940e09dee6e3b78c9a64d52ce9/pr/performance_comparison_arm_release_master_head_iceberg_local_1_2/report.html #128261
The test, new on master, creates an `Enum16` column with `CREATE ... AS SELECT`, which an Iceberg table cannot store. https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/3b910db6cf012b9f141909a79f3a72bec0cc6ebb/pr/performance_comparison_arm_release_master_head_iceberg_local_2_2/report.html #128261
From the CI run of e1b3517: per test, the geometric mean of the Iceberg / MergeTree ratio of the queries measured in both configurations, for `IcebergLocal` and `IcebergS3`, sorted by slowdown. https://performance.ci.clickhouse.com/runs/pr-128261-e1b3517dafb90fd7867b9c37fc21256f94d64c79 #128261
…ance tests `perf.py` digests the result of every SQL query on its prewarm run, so the measured runs are not affected: on the client from the rows the server sends (row count and an order-independent sum of row hashes, floats rounded to 6 significant digits), and for `SELECT ... FORMAT Null` on the server with one more query, `SELECT count(), sum(cityHash64(toString(tuple(*)))) FROM (<query>)`. The digests are `result-digest` lines of the raw output, so they can be compared across jobs as well. Different results of the servers are `result-mismatch` lines and a new report table, "Queries with Different Results", not an error. Tests whose setup generates data with `rand`, `now` and the like, and queries whose result is not deterministic, are not compared. The Iceberg configuration now writes its settings into the default profile of both servers: a dropped table of an `Atomic` database deletes its Iceberg data in the background with the settings of the global context, so the setting of the query did not apply and a test that dropped and recreated a table found its old data. Move the Iceberg vs MergeTree comparison to `tests/performance/docs/`.
The previous commit, 9231cfb, contains only the move of the comparison document; this one is the change its message describes: the result digests of `perf.py`, the "Queries with Different Results" report table, and the Iceberg settings in the default profile of both servers.
A test that creates no MergeTree table would only repeat its MergeTree run. The selection already required a plain `MergeTree` table in a `create_query`, but the nightly prepended `calibration.xml`, which creates none, to the Iceberg jobs too. Now it does not, and `perf.py --table-engine` skips a test without a `create_query`, or whose setup creates no MergeTree table, when it is run directly.
…ration `perf.py --table-engine` now creates the `Memory` tables and the tables of every MergeTree engine as Iceberg tables, not only the plain `MergeTree` ones: the behavior of `ReplacingMergeTree`, `AggregatingMergeTree` and the like is lost, every inserted row is kept. A lightweight `UPDATE t SET ... WHERE ...` of a rewritten table, in the setup or measured, becomes the mutation `ALTER TABLE t UPDATE ... WHERE ...`, which Iceberg tables support. The configuration runs 270 tests instead of 200. The skip list was updated from a local run of every newly selected or changed test with `perf.py --table-engine iceberg_local` on master: `alter_select`, `apply_patch_parts_merge`, `apply_patch_parts_steps` and `skip_index_planning_with_patch_parts` run now; 45 new tests are skipped, mostly for `FINAL`, `AggregateFunction` and `QBit` columns and assertions on MergeTree internals. `apply_patch_parts_join` and `apply_patch_parts_join_intersecting` fail because Iceberg compaction rejects the `OVERWRITE` snapshot of the update (`Unsupported snapshot's operation type OVERWRITE` in `OPTIMIZE`).
…gests * The XML comment of the generated `users.d/zzz-perf-iceberg.xml` contained `--`, which XML does not allow, so both servers of every Iceberg job failed to start (`SAXParseException: Invalid token`). * `compare.sh` reruns flagged queries with `--table-engine` too (`CHPC_TABLE_ENGINE`), so a confirmation reruns on the same Iceberg tables. * A prewarm result is released as soon as its digest is computed, and a result above the digest limit is not kept at all, so the measured runs do not hold it in memory. * Sampling aggregate functions (`quantile*`, `median*`, `groupArraySample`, ...) are not compared, and a difference is reported only if the old server repeats its own result (one more run, only for a mismatch); otherwise the query is `result-nondeterministic`. * The server-side digest of `FORMAT Null` rounds float columns to 6 significant digits, as the client-side digest does. * `Map` entries are sorted by their representation, so keys of different normalized types (an integral and a fractional `Decimal`) do not raise; a digest error makes the query `result-digest-skipped` instead of failing it. https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/82e564e1d2d07b8efb4a7cbcb97cdaa5ec175b6e/pr/performance_comparison_arm_release_master_head_iceberg_local_1_2/job.log #128261
… adds or changes A new performance test that cannot run on Iceberg tables went unnoticed until the nightly run or the next pull request that changes the Iceberg code. Now a pull request that adds or changes a test the configuration selects runs the Iceberg jobs too, on the changed tests only: a test that breaks the configuration fails in the pull request that adds it. A rewrite error tells the author to add the test with the reason to `tests/performance/iceberg_skip_list.txt` or to mark it `<test iceberg="0">`. The paths of the Iceberg code move to `test_discovery.py`, shared by the job filter and the job.
With 270 tests, the 2 batches of 135 tests took 103 to 115 min for `iceberg_local`, and the `iceberg_s3` jobs reached the 2 h timeout before their last tests (exit -15). https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/e161edc5af9ead53dbcfa1120dd24b432e28108c/pr/performance_comparison_arm_release_master_head_iceberg_s3_1_2/job.log #128261
272 tests (the configuration now also rewrites `Memory` and all MergeTree-family tables), both backends. Tests whose usual configuration has `Memory` tables are marked: their ratio is mostly the cost of reading Parquet against reading RAM. https://performance.ci.clickhouse.com/runs/pr-128261-aa299f4c73ba740aabd68bde4871bd377481302e #128261
…loat rounding, generateRandom * Test discovery accepts `ENGINE Memory` without `=`, which 18 more tests use; the skip list follows in the next commit. * `CREATE TABLE ... EMPTY AS SELECT` keeps its `SELECT`: the `AS` inside `EMPTY AS` no longer ends the clause. * The `ci-performance` label runs all the selected tests in the Iceberg configuration, also in a pull request that changes a test. * The server-side digest rounds a constant zero, NaN or infinity float without an exception: both branches of `if` are evaluated for a constant, so `log10` now gets 1 for them. * A setup with `generateRandom` or the `GenerateRandom` engine without a seed generates different data on the servers, so its results are not compared (`parquet_read`, `parquet_read_with_index`, `orc_tuple_field_prune`).
It creates its table with `CREATE TABLE ... AS hits_10m_single`, which copies `UInt64` columns an Iceberg table cannot store. The other newly selected tests that read the `hits` datasets pass. https://s3.amazonaws.com/clickhouse-test-reports/PRs/128261/215bbd6cc18a4f5021ba11af645e6010c8c519c7/pr/performance_comparison_arm_release_master_head_iceberg_local_1_3/report.html #128261
284 tests, with master of 2026-11-02 merged in; no test moved by more than 1.5x against the previous run. https://performance.ci.clickhouse.com/runs/pr-128261-215bbd6cc18a4f5021ba11af645e6010c8c519c7 #128374
…Iceberg code The `ci-performance` label neither runs the Iceberg jobs in a pull request without Iceberg changes, nor makes a pull request that changes only performance tests run all of them: the configuration measures the Iceberg code, so a change elsewhere has nothing to show there.
Instead of a separate `NightlyIcebergPerformance` workflow, its four jobs run in the nightly performance workflow, with the same tested and reference binaries. Their rows stay apart from the MergeTree tests by `arch = 'arm_iceberg_local'` or `'arm_iceberg_s3'`; the docstring of the workflow says how to filter them.
The digest of a `FORMAT Null` statement counted the one row of the server's `count(), sum(...)` answer, so "Queries with Different Results" showed 1 row on both servers for any such query. The server's count and hash now go into the digest as they are, also within a group of statements.
For one validation run of the nightly Iceberg jobs on this branch (`gh workflow run NightlyExtendedPerformance --ref perf-iceberg-config`); reverted in the next commit.
…mance" This reverts commit 66ae30b.
… generateRandom with escaped quotes * The rewrite stops looking for table clauses at `AS` / `EMPTY AS`: an `ORDER BY`, `LIMIT` or `SETTINGS` of the `SELECT` ended the saved `AS` clause and was lost, so the Iceberg fixture held different data. * `generateRandom` counts as seeded only when its structure literal (with its escapes, `\'` and `''`) is followed by a literal number; a seed that cannot be established counts as no seed.
# Conflicts: # .github/workflows/pull_request.yml
fm4v
enabled auto-merge
November 2, 2026 22:11
PedroTadim
pushed a commit
to groeneai/ClickHouse
that referenced
this pull request
Nov 4, 2026
The result digest added in ClickHouse#128261 runs every `FORMAT Null` query once more per server, which added about 43 min per architecture to each master commit and made the `master_head` shards time out. `perf.py --result-digest` now enables it, and `ci/jobs/performance_tests.py` passes it only in nightly runs. Related: ClickHouse#129258
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Nov 6, 2026
…the performance tests
The setup of the test asserts two active parts with
`throwIf(count() != 2) FROM system.parts`. The Iceberg configuration
rewrites its ReplacingMergeTree table to IcebergLocal/IcebergS3, which
has no rows in `system.parts`, so the setup fails with Code 395
("expected 2 active parts") and so does the whole Iceberg perf shard.
The test came with ClickHouse#123326, whose last CI run (2026-10-26) predates
ClickHouse#128261, which started running the Iceberg jobs on the tests a PR adds,
so it never ran in this configuration before it reached master.
The reason is the one of lazy_final_early_exit_limit.xml,
lazy_materialization_final_limit.xml and read_in_reverse_order_final.xml,
which have the same check over `system.parts` plus FINAL.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
cursor Bot
pushed a commit
to ylw510/ClickHouse
that referenced
this pull request
Nov 6, 2026
…e performance tests The test has a `JSON(max_dynamic_paths = 0)` column, which the Iceberg rewrite of the perf runner cannot map, so every Iceberg perf job that selects it fails with `IcebergRewriteError: Column j of type JSON(...) has no Iceberg equivalent` (6 PRs on 2026-11-05). It came from ClickHouse#124553, whose last CI run predates the Iceberg jobs running on the tests a PR adds (ClickHouse#128261), so it was never run in this configuration. Add it to the skip list with the reason `JSON column`, like prewhere_subcolumns.xml. Its other table (bucketed Map) measures a MergeTree-only PREWHERE read-step behaviour, so there is nothing to measure on Iceberg. Validated with test_discovery.test_runs_with_table_engine: 291 tests selected before, 290 after (this one removed). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 7, 2026
eoger-ant
pushed a commit
to eoger-ant/ClickHouse
that referenced
this pull request
Nov 16, 2026
Since ClickHouse#128261 a PR that changes only performance tests runs the Iceberg jobs on the changed tests only, so often no query is measured on both servers (the Iceberg rewrite refuses every changed test, only partial queries, or a skipped test). Then analyze_queries crashed: query-run-metric-names.tsv is empty, so its scalar subquery throws INCORRECT_RESULT_OF_SCALAR_SUBQUERY, and the per-query loop never creates analyze/commands.txt and analyze/query-metric-stats.tsv. The denorm file was never written, report() stopped at its first read, before it wrote all-query-metrics.tsv and the other comparison files, the check said "Errors while building the report." instead of the per-test errors, and "Insert historical data" failed with FileNotFoundError. Create the two files before the loop, the same way confirm_changes already does for its own files, and take any(n) from the names file: an aggregate without GROUP BY returns one row, [] for an empty file and the only row otherwise. The Total ratio of a report with no compared query is the neutral 1x instead of nan, as for a test whose changes are all demoted. A run with compared queries writes the same files as before. Validated by replaying compare.sh (stage=analyze_queries) in the performance-comparison image on the CI artifacts of ClickHouse#101273, ClickHouse#113575 and ClickHouse#126132 (before: the CI errors; after: an empty errors.log, and "20 errors" with the Iceberg rewrite hint for ClickHouse#101273), and on a MergeTree job of ClickHouse#101273 (same analysis and report files). Related: ClickHouse#101273 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run the performance tests a second time with their MergeTree tables created as Iceberg tables, so that the same queries measure the Iceberg read and write path, in two backends:
IcebergLocalandIcebergS3(the job-local S3 endpoint).How it works:
perf.py --table-engine iceberg_local|iceberg_s3rewrites everyCREATE TABLEof a MergeTree-family orMemorytable among the setup queries (tests/performance/scripts/iceberg_engine.py). The statement is formatted withclickhouse format --onelineof the tested binary first, so the rewrite works on one canonical syntax. The engine becomesIcebergLocal/IcebergS3with the pathperf_iceberg/<test>/<table>/; the leading plainORDER BYcolumns stay as the sort order;PARTITION BY,PRIMARY KEY,SAMPLE BY,TTL,SETTINGS, indexes, projections and codecs are dropped; types Iceberg cannot store are widened (UInt8/Int16/... toInt32,UInt64toInt64since master rejectsUInt64onCREATE,LowCardinality(T)toT,Enum/FixedStringtoString, ...). The behavior ofReplacingMergeTree,AggregatingMergeTreeand the like is lost (every row is kept); a lightweightUPDATEof a rewritten table becomes anALTER TABLE ... UPDATEmutation. A column an Iceberg table cannot store even widened (AggregateFunction,JSON,Dynamic,MATERIALIZED,ALIAS) is an error, not a silent skip.Memorytable in acreate_query, minuslongtests,<test iceberg="0">andtests/performance/iceberg_skip_list.txt. That is 270 tests; the skip list has 123, each with its reason. A failure of a test outside the list is a real error. There is deliberately no "skip when it fails on both servers": that would report a regression that breaks IcebergCREATE/INSERTas a skipped test.arch = 'arm_iceberg_local'/'arm_iceberg_s3'. The performance tables (query_metrics_v2, the dashboard inputs) and the dashboard filters have no column for the job, so without it the Iceberg rows of a PR would be read by the dashboard gate of its MergeTree shards, and nightly rows would mix with the MergeTree nightly of the same test names. The configuration itself uses no learned thresholds and no dashboard gate.Performance Comparison (arm_release, master_head, iceberg_local|iceberg_s3, N/3), only when the PR changessrc/Storages/ObjectStorage/,src/Databases/DataLake/, the Parquet formats or the harness (all the selected tests), or adds or changes a performance test the configuration selects (that test only), withallow_failureuntil the noise of this configuration is known.NightlyExtendedPerformance(arm_release, master_head, nightly, iceberg_local|iceberg_s3, N/2), with the same tested and reference binaries as its MergeTree jobs (the reference is the previous night's tested binary). Every query of every selected test, ARM only; the rows are told apart byarch.Validation: every one of the 281 tests with a plain
MergeTreetable was run with this rewrite on a local master build (26.11.1.917, fills capped at 8 s, queries at 2 s) and compared with the same test on MergeTree; the skip list is the tests with a new error (39 are rejected by the rewrite itself, 33 fail when run); the first complete CI run added 10 tests that need the CI datasets or fail on assertions about MergeTree internals. An A/A run ofperf.py --table-engine iceberg_localagainst two local master servers (group_by_sundy_li,window_partitions) created, measured and dropped the Iceberg tables on both servers. Theiceberg_s3backend runs for the first time in the CI of this PR, which changes the harness and so runs the Iceberg jobs. The nightly jobs can be tried before merge withgh workflow run NightlyExtendedPerformance --ref perf-iceberg-config(that also runs its MergeTree jobs).Findings from the sweep, for reference: on 26.8 and 26.9, a
UInt32column of an Iceberg table wraps (4294967295reads back as-1), fixed in 26.10 by #118596 and not backported. A failed IcebergCREATEleaves an orphanmetadata/directory on master.Result comparison:
perf.pynow digests the result of every SQL query on its prewarm run (on the client for the rows the server sends, on the server with one extra query forFORMAT Null) and lists the queries whose results differ between the servers in a new report table, "Queries with Different Results" (not an error). Theresult-digestlines in the raw output make results comparable across jobs too, e.g. a test on Iceberg tables with the same test on MergeTree.Related: #128374
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/128261]
Version info
26.11.1.1163-master(included in26.11and later)