Repository navigation
Add Delta Lake tables to the data lake corpus and tests of Delta Lake features - #129100
Merged
Merged
Conversation
… features Extend `utils/data-lake-corpus` with a `delta` kind (`delta_gen.py`, `writers/spark_delta_writer.py`, `writers/deltars_delta_writer.py`): 34 tables written by Spark 4.1.1 with Delta Lake 4.4.1, Spark 3.5.5 with Delta Lake 3.3.2, and delta-rs 1.6.6. Every version of every table is read back by the writer, and `checks_delta.sql` (run by `05560_delta_lake_corpus`) compares what ClickHouse reads for each version (`delta_lake_snapshot_version`) and for the change data feed (`delta_lake_snapshot_start_version`) with the readback. The tables cover deletion vectors (with checkpoints, column mapping, partitions, MERGE, RESTORE), column mapping in `id` and `name` modes with renamed and dropped nested columns, schema evolution, type widening (including nested fields, array elements, map keys and values, and partition columns), v2 checkpoints with JSON and Parquet top-level files and sidecars, multi-part checkpoints, row tracking, in-commit timestamps, liquid clustering, `icebergCompatV2`, identity, generated and default columns with CHECK constraints, the change data feed with deletion vectors and column mapping, partition values with special characters and nulls, and `VARIANT`. New tests of ClickHouse behavior on top of these tables: - `05561_delta_lake_deletion_vectors`: count() with and without `optimize_count_from_files`, filters, virtual columns (`_row_number`, `_file`, `_path`, `_data_lake_snapshot_version`), tiny blocks, time travel, the table engine. - `05562_delta_lake_checkpoint_discovery`: no `_last_checkpoint`, a stale one, and a log cleaned up before the newest classic, multi-part, or v2 checkpoint. - `05563_delta_lake_change_data_feed_deletion_vectors_column_mapping`: version ranges, filters, invalid ranges. - `05564_delta_lake_type_widening`: the types of every version, filters on widened columns, nested widening. - `05565_delta_lake_data_skipping_profile_events`: file skipping by statistics and partition values (`DeltaLakeScannedFiles`, `DeltaLakePartitionPrunedFiles`). - `05566_delta_lake_s3_deletion_vectors_change_data_feed`: `deltaLake`, `deltaLakeCluster`, and `DeltaLake` over S3. - `05567_delta_lake_write_into_tables_with_features`: INSERT into tables with deletion vectors, v2 checkpoints, the change data feed, row tracking and in-commit timestamps, and rejection of unsupported writer features. The references record two ClickHouse bugs found by the corpus: with column mapping, the fields of a struct inside an `Array` or a `Map` are read as empty or NULL, and a subcolumn of a partitioned table fails with `UNKNOWN_IDENTIFIER`. Deletion vector files (`*.bin`) are ignored by `.gitignore`, so the corpus directory gets an exception. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Workflow [PR], commit [2c62631] Summary: ✅ AI ReviewSummaryAdds 34 Delta Lake corpus tables from three writer versions, writer readbacks for snapshot and change-feed comparisons, and eight stateless tests covering reading, checkpoints, pruning, and writes. No new actionable findings. Both earlier findings are addressed: appended row IDs are checked against the previous high-water mark, and the tiny-block case now limits the Parquet block size. Missing context / blind spots
Final Verdict✅ Approve — no unresolved review findings; normal CI validation remains pending. |
…pping_profile_events` The setting is randomized in CI. With it disabled, `p_str = ''` is not rewritten into `empty(p_str)`, is passed to delta-kernel-rs as a predicate, and the files are pruned by the scan instead of by ClickHouse, so `DeltaLakeScannedFiles` and `DeltaLakePartitionPrunedFiles` differ from the reference. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129100&sha=07815e1858894e0a24048f695b00305933d2a03b&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29 #129100 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gh water mark In `05567_delta_lake_write_into_tables_with_features`, compare `baseRowId` of the appended files with `rowIdHighWaterMark` of the previous commit, so reused row ids are detected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…g fix The column-mapped tables (`column_mapping_id`, `delta332_column_mapping_id`, `iceberg_compat_v2`) are now read the same as their writers read them, including structs inside arrays and maps and their subcolumns. Related: #129103 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…f `05561_delta_lake_deletion_vectors` `max_block_size` does not limit the chunks produced by the Parquet reader, so every corpus file was read as a single chunk and deletion vector offsets across chunks of the same file were not exercised. Set `input_format_parquet_max_block_size` too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Nov 7, 2026
… table function With parallel replicas, `deltaLake` and other data lake table functions with a `Cluster` variant were replaced with it even when reading the change data feed (`delta_lake_snapshot_start_version`, `delta_lake_snapshot_end_version`). The change data feed is read by `ReadFromDeltaLakeTableChangesStep`, which does not distribute work between replicas, so every replica returned all changes and each row was returned once per replica. Do not use parallel replicas for it, as `getStorageForParallelReplicasRead` already does for tables. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129100&sha=e976b03a34770f15d52f3d8bec00636f8f51d88f&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 Related: ClickHouse#129100 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ith `parallel_replicas_for_cluster_engines` With parallel replicas, `deltaLake` over S3 was converted to `deltaLakeCluster`, but the change data feed (`delta_lake_snapshot_start_version`) is not split into tasks, so every replica read the whole feed and `05566_delta_lake_s3_deletion_vectors_change_data_feed` returned each change three times. The `DeltaLake` table engine already skips its parallel replicas read for the change data feed in `getStorageForParallelReplicasRead`; do the same for the table function. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129100&sha=6f4ec0fe42fe527afe5f59173cd256dc878bcf83&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 PR: #129100 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r read with `parallel_replicas_for_cluster_engines`" This reverts commit 549352d.
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.
Tests for Delta Lake features that were not tested or barely tested: deletion vectors, the change data feed with deletion vectors and column mapping, type widening,
VARIANT, v2 checkpoints with and without sidecars, multi-part checkpoints, row tracking, in-commit timestamps, liquid clustering and domain metadata,icebergCompatV2, writer features (identity, generated and default columns, CHECK constraints), and tables without_last_checkpoint.Corpus.
utils/data-lake-corpusgets adeltakind, mirroring the Iceberg part. It covers 34 tables written by three writers:Every version of every table is read back by its writer.
checks_delta.sql, run by05560_delta_lake_corpus, compares what ClickHouse reads with that readback:delta_lake_snapshot_version;delta_lake_snapshot_start_version, against the writer'stable_changes.The corpus adds 4.1 MB of tables and 1.5 MB of expected data.
Tests of ClickHouse behavior on these tables. They are stateless; the S3 test uses
s3_conn.05561: deletion vectors with:optimize_count_from_files;_row_number,_file,_pathand_data_lake_snapshot_versionvirtual columns;DeltaLakeLocalengine;05562: checkpoint discovery without_last_checkpoint, with a stale one, and after log cleanup, for classic, multi-part, and v2 checkpoints.05563: the change data feed with deletion vectors and column mapping: version ranges, filters, and invalid ranges.05564: type widening: the types of each version, filters on widened columns (old files keep statistics of the narrow type), and widening of nested fields and partition columns.05565: file skipping by statistics and partition values, observed throughDeltaLakeScannedFilesandDeltaLakePartitionPrunedFiles.05566:deltaLake,deltaLakeCluster, and theDeltaLakeengine over S3, with deletion vectors, sidecars, and the change data feed.05567: INSERT into tables with features:baseRowId,defaultRowCommitVersion,inCommitTimestampand the high-water mark;Bugs found. The references record the current wrong results, so the fixes will update them:
Arrayor aMapare read as empty or NULL.st.a,arr.size0) of a partitioned table fails withUNKNOWN_IDENTIFIERwhen read through delta-kernel-rs..gitignoreignores*.bin, so the corpus directory gets an exception for deletion vector files.05566_delta_lake_s3_deletion_vectors_change_data_feedfound duplicated rows of the change data feed with parallel replicas, fixed in #129548.Related: #129548
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/129100]
Version info
26.11.1.1630-master(included in26.11and later)