Skip to content

Add Iceberg tables from the parquetry test kit as stateless tests - #130017

Open
alexey-milovidov wants to merge 7 commits into
masterfrom
iceberg-tileverse-tables
Open

alexey-milovidov wants to merge 7 commits into
masterfrom
iceberg-tileverse-tables

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Adopt the Iceberg tables of the parquetry test kit (internal/parquetry-testkit/src/main/resources/iceberg-* at https://github.com/tileverse-io/parquetry/tree/fba9d4db27f93fd7e21f2dd121bd81f40646347e/internal/parquetry-testkit/src/main/resources, Apache-2.0) as stateless tests. It includes the geospatial tables of https://github.com/jatorre/iceberg-geo-testbed (commit 59f47a71f641f14994f54e279791e8188edc723f, Apache-2.0), which parquetry vendors. Most tables were written by the Apache Iceberg 1.11.0 Java API or Spark; the rest by PyIceberg.

All 16 tables (151 files, 2.2 MB) are added to tests/queries/0_stateless/data_iceberg/tileverse, unmodified. Their locations are rooted at file:///iceberg-<corpus>/<table>. The expected results come from the parquetry generator documentation (row sets and per-row lineage values that Iceberg's own reader reports), the parquetry tests, and the testbed's California probe (196 rows). Pseudo-random columns are checked with aggregates that match PyIceberg 0.12.0 and reading the Parquet files directly.

Tests:

  • 05616_iceberg_tileverse_deletes: positional deletes (Spark), equality deletes with a NULL key component, an equality delete keyed on an identity partition column that is omitted from the data files, and a deletion vector.
  • 05617_iceberg_tileverse_scalar_types: every scalar type in a v3 table (timestamp[tz], timestamp[tz]_ns, time, decimal on INT32 and FIXED_LEN_BYTE_ARRAY, uuid, fixed, binary, date), partitioned by identity(ts), with partition-scoped equality deletes keyed on uuid and decimal, plus filters on each bound encoding.
  • 05618_iceberg_tileverse_partitioned_name_mapping: identity partitions with the column kept in or omitted from the data files, and a migrated table without Parquet field ids, read through schema.name-mapping.default.
  • 05619_iceberg_tileverse_row_lineage: _row_id inherited cumulatively within a manifest (data file first_row_id is NULL), and _row_id materialized in a data file with a mix of stored and NULL cells.
  • 05620_iceberg_tileverse_geo: flat bbox columns, a bbox struct, the GeoIceberg V2 convention with WKB, native geometry (allow_geo_types_in_iceberg) with and without materialized lineage columns, and the California probe.

iceberg-deletes/positional: parquetry expects 890 rows, but when the table was vendored, the file_path bounds of the position delete file were not rewritten. They still name the data file at its generation path, so Apache Iceberg (DeleteFileIndex) and PyIceberg do not apply the delete file and return 1000 rows. This is a defect of the upstream fixture (parquetry's vendoring step), not of ClickHouse. ClickHouse returns 1000 rows too, and the reference keeps that (explained in the test and the README).

The row lineage pruning bug that 05619_iceberg_tileverse_row_lineage exposed (files with a stored _row_id were pruned by their first_row_id range) is fixed on master by #130100, which vendored the same iceberg-row-lineage/materialized table.
Related: #130022
Related: #130100

All five tests pass on master.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


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

16 Iceberg tables from https://github.com/tileverse-io/parquetry/tree/fba9d4db27f93fd7e21f2dd121bd81f40646347e/internal/parquetry-testkit/src/main/resources
(Apache-2.0), including the vendored https://github.com/jatorre/iceberg-geo-testbed
(Apache-2.0): positional and equality deletes, deletion vectors, every scalar type,
row lineage, identity partitions omitted from data files, name mapping, and geospatial
tables. The expected results are taken from the generator documentation and tests of
parquetry and the geo testbed.

`05738_iceberg_tileverse_row_lineage` fails until a data file that materializes
`_row_id` is no longer pruned by its `first_row_id` range.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov alexey-milovidov added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 7, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3c7aa2c]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/can_be_merged.py --review-threads FAIL

AI Review

Summary

Adds five stateless tests covering 16 upstream Iceberg tables, including deletes, scalar types, partitions, name mapping, row lineage, and geometry. Reviewed head 3c7aa2cfbc348c37fb92130ae37169a28499a5d3. No new inline findings; the previously reported binary-corpus blocker remains. The upstream attribution finding is fixed.

Missing context / blind spots
  • ⚠️ No local ClickHouse binary is available, and the current targeted CI report contains no individual test results. A completed run of 05616–05620 would close the execution-validation gap.
Findings

❌ Blockers

  • tests/queries/0_stateless/data_iceberg/tileverse/README.md:13 [dismissed by author -- https://github.com/Add Iceberg tables from the parquetry test kit as stateless tests #130017#discussion_r4511169855] The diff still adds 129 binary fixtures totaling 2,135,120 bytes. Hermetic execution and existing fixtures explain the choice, but do not remove the permanent clone cost or satisfy the review rule against committing binary datasets over 1 MB. Stage the pinned, checksum-verified corpus as a CI input or test-image asset, preserving offline test execution and the existing assertions. No duplicate inline comment was posted.
Final Verdict

Status: ❌ Block

Move the binary corpus outside Git and confirm that all five tests pass. The author’s decision is recorded above; the existing thread is left unchanged.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 7, 2026
arsenmuk pushed a commit to melvynator/ClickHouse that referenced this pull request Nov 8, 2026
A row's `_row_id` is the value stored in the data file, or `first_row_id`
plus its position where the file stores NULL; `_last_updated_sequence_number`
falls back to the data sequence number the same way. The manifest-level
pruning used the declared bounds of a lineage column only when the column
has no nulls, and otherwise the range `[0, first_row_id + record_count - 1]`
(`[0, sequence number]`), which assumes a stored value is below the
inherited block. Files that store values above it (compaction or
copy-on-write keeping row ids, or other writers) were skipped and their rows
lost: `WHERE _row_id > 1000` on the parquetry `iceberg-row-lineage/materialized`
table returned nothing instead of ids 6 and 8, and the DuckDB
`row_lineage_stored_columns` table (no statistics at all) lost the rows with
stored `_row_id` 100/103 and sequence numbers 7/9.

A file is now pruned by a lineage column only when its manifest declares
bounds for it; when some rows may store NULL the range is the hull of the
declared bounds and the inherited range. Without declared bounds (absent,
undecodable or inverted) the file is not pruned by that column. The early
returns for a missing `first_row_id`, an empty file, a negative sequence
number and a block that does not fit in UInt64 stay as they were.

The new test vendors both tables unmodified, at the paths used by ClickHouse#130017
and ClickHouse#130010.

Closes ClickHouse#130022

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`59f47a71f641f14994f54e279791e8188edc723f` (Apache License 2.0,
https://github.com/jatorre/iceberg-geo-testbed/blob/59f47a71f641f14994f54e279791e8188edc723f/LICENSE).

All 16 tables are included, the files are not modified:

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.

[Blocker] Fetch the binary corpus instead of committing it

This import adds 129 binary fixture files (86 Parquet, 42 Avro, and one Puffin), totaling 2,135,120 bytes, directly to Git. That makes the corpus a permanent cost for every full clone; deleting the files later does not remove their blobs from history. The review instructions prohibit committing binary datasets of this size. Please store the corpus as external test data and stage it from a pinned, checksum-verified source during test setup, retaining the existing assertions and directory layout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🕵 Not changed for now, a maintainer should decide this. Reasons for keeping the files in the repository: stateless tests are hermetic and run without network access, so fetching from an external source at setup would add a new dependency and a failure mode to CI. The repository already keeps comparable binary fixtures for stateless tests (data_iceberg was 1.1 MB before this PR, data_minio is 8.5 MB). This corpus is about 2.1 MB, its files are small, and they are copied unmodified from a pinned upstream commit, so they will not churn. If the maintainers prefer external storage, the tests can be changed to stage the corpus from a pinned, checksum-verified archive.

alexey-milovidov and others added 2 commits November 10, 2026 09:52
…verse fixtures

Apache License 2.0 section 4(d) requires retaining the attribution of the
upstream `NOTICE` file when redistributing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov
alexey-milovidov marked this pull request as ready for review November 16, 2026 16:41
@clickhouse-gh clickhouse-gh Bot added comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... and removed comp-testing Test content only (no production code). labels Nov 19, 2026

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

comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant