Skip to content

Tests with Iceberg tables from the Apache Impala test data - #130028

Open
alexey-milovidov wants to merge 11 commits into
masterfrom
iceberg-impala-tables
Open

alexey-milovidov wants to merge 11 commits into
masterfrom
iceberg-impala-tables

Conversation

@alexey-milovidov

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

Copy link
Copy Markdown
Member

Stateless tests with the Iceberg tables of the Apache Impala test data: testdata/data/iceberg_test at https://github.com/apache/impala/tree/e35eb8f3582449d736e74ce32f1138f5f5dc085b/testdata/data/iceberg_test (Apache License 2.0), 61 tables, 2.5 MB, in tests/queries/0_stateless/data_iceberg/impala/ with a README.md describing the provenance. The files and the directory layout are not modified: the metadata refers to /test-warehouse/..., file:///... and file:/... locations, and to data in sibling directories of the table (iceberg_multiple_storage_locations).

The expected results are those of the Impala tests (testdata/workloads/functional-query/queries/QueryTest/iceberg-*.test, tests/query_test/test_iceberg.py), cross-checked with PyIceberg on a scratch copy with rewritten paths. For values Impala does not read (ORC/Avro uuid and variant, binary/timestamptz initial defaults), the values decoded from the data files or the table metadata.

Tests:

  • 05616_iceberg_impala_v1_tables: format version 1 tables by Spark 2.4 and Hive + Iceberg 0.11 (legacy schema without schema-id, no sort-orders), identity/hour partitions of all types, partition column promotion, timestamps before 1970, nested ORC types, files without field ids, data outside the table location.
  • 05617_iceberg_impala_position_deletes: position deletes (Parquet and ORC data files, partitioned, all rows deleted, dangling delete after compaction).
  • 05618_iceberg_impala_equality_deletes: equality deletes (NULLs, several equality field ids, mixed with position deletes, schema evolution, time travel).
  • 05619_iceberg_impala_misc_tables: v2 tables without deletes, upper case column names, migrated Hive tables, mixed Parquet/ORC, Puffin statistics.
  • 05620_iceberg_impala_uuid: uuid in Parquet/ORC/Avro, identity and bucket partitions on uuid.
  • 05621_iceberg_impala_v3_default_values: initial-default for all primitive types, Parquet/ORC/Avro, partitioned by the defaulted column.
  • 05622_iceberg_impala_v3_deletion_vectors_row_lineage: deletion vectors, _row_id / _last_updated_sequence_number before and after compaction.
  • 05623_iceberg_impala_v3_variant: variant written by Trino and Spark, nested in arrays/maps/structs, in Parquet/ORC/Avro.

Left out (see README): iceberg_v2_null_delete_record (NULL file_path in position deletes, which Impala skips with a warning), iceberg_v2_delete_equality_partition_evolution (Impala refuses it, no expected result), iceberg_lineitem_multiblock (1.8 MB data file, too large for the repository).

Must be merged after the fixes of:

Related: #129991
Related: #129989
Related: #129990
Related: #129992
Related: #129993
Related: #129994
Related: #123961
Related: #129998
Related: #130001
Related: #130023
Related: #128304
Related: #130031
Related: #130032

Position deletes are not applied when the delete file refers to the data file as hdfs://localhost:20500/test-warehouse/... and the manifest as /test-warehouse/... (raw string comparison of paths), see the comment in #129990. The missing schema-id in manifest headers and the missing sort-orders are covered by #129991.

Which tests fail until then:

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


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

The tables of `testdata/data/iceberg_test` from apache/impala at
e35eb8f3582449d736e74ce32f1138f5f5dc085b (Apache-2.0), with the expected
results of the Impala tests (`iceberg-*.test`, `test_iceberg.py`): format
version 1 tables with legacy metadata, position and equality deletes,
migrated tables, `uuid`, v3 default values, deletion vectors, row lineage
and `variant`.

Many of the tests fail until the corresponding bugs are fixed, see the
comments in the tests.

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 [5c9f995]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_asan_ubsan, targeted) FAIL
05616_iceberg_impala_v1_tables FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05620_iceberg_impala_uuid FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05623_iceberg_impala_v3_variant FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_asan_ubsan, flaky check) FAIL
05618_iceberg_impala_equality_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_tsan, flaky check) FAIL
05621_iceberg_impala_v3_default_values FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_msan, flaky check) FAIL
05621_iceberg_impala_v3_default_values FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05620_iceberg_impala_uuid FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_debug, flaky check) FAIL
05620_iceberg_impala_uuid FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_binary, flaky check) FAIL
05620_iceberg_impala_uuid FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05620_iceberg_impala_uuid FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05623_iceberg_impala_v3_variant FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
Too many test failures FAIL cidb
Stateless tests (amd_debug, parallel) FAIL
05620_iceberg_impala_uuid FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05623_iceberg_impala_v3_variant FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
Stateless tests (arm_binary, parallel) FAIL
05618_iceberg_impala_equality_deletes FAIL cidb
05621_iceberg_impala_v3_default_values FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05623_iceberg_impala_v3_variant FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05620_iceberg_impala_uuid FAIL cidb
Stateless tests (amd_asan_ubsan, db disk, distributed plan, targeted) FAIL
05616_iceberg_impala_v1_tables FAIL cidb
05620_iceberg_impala_uuid FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05617_iceberg_impala_position_deletes FAIL cidb
05616_iceberg_impala_v1_tables FAIL cidb
05618_iceberg_impala_equality_deletes FAIL cidb
05619_iceberg_impala_misc_tables FAIL cidb
05623_iceberg_impala_v3_variant FAIL cidb
Too many test failures FAIL cidb
Fast test (arm_darwin) DROPPED

AI Review

Summary

Adds eight stateless interoperability tests using Apache Impala Iceberg fixtures, covering legacy metadata, position and equality deletes, UUIDs, v3 defaults, deletion vectors, row lineage, and variants. No new actionable findings. The previously reported oversized fixture has been removed, and its resolved thread remains closed.

Missing context / blind spots
  • ⚠️ Runtime validation remains pending: no ClickHouse binary is available locally, and the current CI run has no results for the eight new scripts. The successful Fast test excludes them through no-fasttest. Several cases intentionally depend on the reader fixes already linked as merge prerequisites in the PR description; passing stateless CI after those fixes will close this gap.
Final Verdict

Status: ✅ Approve

The test changes are suitable for approval. Merge remains contingent on the documented reader fixes and passing stateless CI.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 7, 2026
alexey-milovidov pushed a commit to punithns97/ClickHouse that referenced this pull request Nov 8, 2026
`05613` reads the Impala `iceberg_v3_row_lineage_orc` table (Spark, three
appends and a compaction that stores the lineage columns), byte-identical to
the copy in ClickHouse#130028. `05614` checks the inherited lineage of ClickHouse-written
v3 tables with ORC and Avro data files, also after a schema change, and reads
ORC files after a skipped row group.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov and others added 4 commits November 10, 2026 07:47
…eberg tests

Its Parquet data file is 1.8 MB, too large to be added to the repository.
Fetching it from GitHub at test time would make the stateless test depend on
network access, so the table is left out instead and listed in the README.

#130028

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
PedroTadim pushed a commit to hsusul/ClickHouse that referenced this pull request Nov 18, 2026
An Iceberg field added with an `initial-default` must read as that default in
every data file written before it was added (spec, "Column Projection"). The
key was never parsed, so such rows read as NULL, filters on the column missed
them, and a required field added with a default made the table unreadable.

A field absent from a data file is synthesized in two places, and both now use
the default:
- the schema evolution DAG, for a file read under its own older schema: the
  constant of a new top-level field, and `AddingTransform` for a field added
  inside a struct (also inside list elements and map values);
- the format reader, for a file read under the schema that has the field (its
  manifest was rewritten under the newer schema and the old snapshot expired,
  or a stale ClickHouse INSERT): Parquet (top level, struct elements at any
  depth, requested subcolumns), ORC (top level and struct elements) and Avro
  (top level), through a new `ColumnMapper` map of defaults.

The JSON single-value serialization (spec Appendix D) of every type is parsed
once in `IcebergSchemaProcessor`; a malformed default, or a non-null one for a
type that must default to null, fails with ICEBERG_SPECIFICATION_VIOLATION
instead of being ignored. A struct field's own default can only be `{}`, which
stands for the defaults of its fields.

A reader fills a field with its default only when the data file identifies
the fields at that level by field id and none of them has the field's id, the
rule ClickHouse#126879 introduced for Avro: a field missing only by name may be in the
file under another name. With that proof, ORC and Avro no longer read such a
column from a same-named field of the file (a dropped column re-added under
the same name), and ORC builds no search argument for that file, because it
resolves predicate columns by name.

The query condition cache key of UUID-less tables and the Parquet columns cache
identity now include the defaults, since the value read for an absent field
depends on them. A metadata.json schema replaces an identical copy registered
from a manifest header, which does not carry `initial-default`.

The new test reads the Apache Impala and DuckDB Iceberg tables of ClickHouse#130028 and
ClickHouse#130010 (identical files) as written and with their older data files bound to
the newer schema, and ClickHouse-written Parquet, ORC and Avro tables evolved
with nested, required, struct, list and malformed defaults.

Closes ClickHouse#129992

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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