Skip to content

Core: Fix TestReplacePartitions using wrong table for validation#15798

Merged
singhpk234 merged 1 commit intoapache:mainfrom
RussellSpitzer:fix-replace-partitions-test
Mar 28, 2026
Merged

Core: Fix TestReplacePartitions using wrong table for validation#15798
singhpk234 merged 1 commit intoapache:mainfrom
RussellSpitzer:fix-replace-partitions-test

Conversation

@RussellSpitzer
Copy link
Copy Markdown
Member

Discovered when fixing - #15634

Previously this wasn't an issue because the validation table was close enough to the tables being tested that everything worked out. Parquet manifests changed the structure for partitioned vs unpartitioned tables, the validation table was partitioned so validation began to fail.


Three test methods in TestReplacePartitions operate on separate unpartitioned or all-void tables but were passing the wrong table instance to commit() and validation helpers:

  • testReplaceWithUnpartitionedTable used commit(table, ...) instead of commit(unpartitioned, ...) for operations on the unpartitioned table
  • testReplaceAndMergeWithUnpartitionedTable had the same issue
  • validateSnapshot and validateManifestEntries were called without specifying which table to use for reading manifests, defaulting to the partitioned test table instead of the actual target table

The commit(table, ...) bug was introduced in #6650 when the test was refactored from direct toBranch().commit() calls to use the commit() helper. The validation calls for the all-void unpartitioned table (added in #14186) also used the default overloads that read manifests via the wrong table's specs.

This adds Table-accepting overloads for validateSnapshot and validateManifestEntries in TestBase and updates the affected tests to pass the correct table instance.

Cursor + Claude-4.6-opus-high

Three test methods in TestReplacePartitions operate on separate
unpartitioned or all-void tables but were passing the wrong table
instance to commit() and validation helpers:

- testReplaceWithUnpartitionedTable used commit(table, ...) instead of
  commit(unpartitioned, ...) for operations on the unpartitioned table
- testReplaceAndMergeWithUnpartitionedTable had the same issue
- validateSnapshot and validateManifestEntries were called without
  specifying which table to use for reading manifests, defaulting to
  the partitioned test table instead of the actual target table

The commit(table, ...) bug was introduced in apache#6650 when the test was
refactored from direct toBranch().commit() calls to use the commit()
helper. The validation calls for the all-void unpartitioned table
(added in apache#14186) also used the default overloads that read manifests
via the wrong table's specs.

This adds Table-accepting overloads for validateSnapshot and
validateManifestEntries in TestBase and updates the affected tests
to pass the correct table instance.
Copy link
Copy Markdown
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you so much for fixing it @RussellSpitzer !

Copy link
Copy Markdown
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @RussellSpitzer

@singhpk234 singhpk234 merged commit 31f3661 into apache:main Mar 28, 2026
34 checks passed
@singhpk234
Copy link
Copy Markdown
Contributor

Thanks for the change @RussellSpitzer ! thank for the review @huaxingao

manuzhang pushed a commit to manuzhang/iceberg that referenced this pull request Mar 30, 2026
…che#15798)

Three test methods in TestReplacePartitions operate on separate
unpartitioned or all-void tables but were passing the wrong table
instance to commit() and validation helpers:

- testReplaceWithUnpartitionedTable used commit(table, ...) instead of
  commit(unpartitioned, ...) for operations on the unpartitioned table
- testReplaceAndMergeWithUnpartitionedTable had the same issue
- validateSnapshot and validateManifestEntries were called without
  specifying which table to use for reading manifests, defaulting to
  the partitioned test table instead of the actual target table

The commit(table, ...) bug was introduced in apache#6650 when the test was
refactored from direct toBranch().commit() calls to use the commit()
helper. The validation calls for the all-void unpartitioned table
(added in apache#14186) also used the default overloads that read manifests
via the wrong table's specs.

This adds Table-accepting overloads for validateSnapshot and
validateManifestEntries in TestBase and updates the affected tests
to pass the correct table instance.
ldudas-marx pushed a commit to ldudas-marx/iceberg that referenced this pull request Mar 31, 2026
…che#15798)

Three test methods in TestReplacePartitions operate on separate
unpartitioned or all-void tables but were passing the wrong table
instance to commit() and validation helpers:

- testReplaceWithUnpartitionedTable used commit(table, ...) instead of
  commit(unpartitioned, ...) for operations on the unpartitioned table
- testReplaceAndMergeWithUnpartitionedTable had the same issue
- validateSnapshot and validateManifestEntries were called without
  specifying which table to use for reading manifests, defaulting to
  the partitioned test table instead of the actual target table

The commit(table, ...) bug was introduced in apache#6650 when the test was
refactored from direct toBranch().commit() calls to use the commit()
helper. The validation calls for the all-void unpartitioned table
(added in apache#14186) also used the default overloads that read manifests
via the wrong table's specs.

This adds Table-accepting overloads for validateSnapshot and
validateManifestEntries in TestBase and updates the affected tests
to pass the correct table instance.
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.

3 participants