Skip to content

Conversation

@bk-mz
Copy link

@bk-mz bk-mz commented Jan 19, 2026

Summary

Fixes rewrite_position_delete_files failing with ValidationException: Invalid partition field parent when tables contain array or map columns.

Root Cause

ExpressionUtil.identitySpec() attempted to create identity partition fields for all primitive fields in the schema, including those nested inside arrays and maps. Since commit 9fb80b7, PartitionSpec.checkCompatibility() validates that partition field parents must be struct types, causing the failure.

Fix

identitySpec() now filters out fields that cannot be partition sources by checking that all ancestor types are structs, using TypeUtil.indexParents() - the same approach used in PartitionSpec.checkCompatibility().

Testing

Added test case that reproduces the issue with a table containing ARRAY<STRUCT<...>> column.

Fixes #15080

… columns

This test demonstrates a regression in Iceberg 1.10.0 where
rewrite_position_delete_files fails with ValidationException when the
table contains array columns with primitive fields.

The error occurs because ExpressionUtil.identitySpec() creates a
temporary partition spec from schema field IDs, and the new validation
added in commit 9fb80b7 rejects fields whose parent type is a list.
ExpressionUtil.identitySpec() now skips fields that cannot be partition
sources. Fields nested inside arrays or maps are filtered out by checking
that all ancestor types are structs, matching the validation logic in
PartitionSpec.checkCompatibility().

Fixes apache#15080
@bk-mz bk-mz changed the title Add test reproducing rewrite_position_delete_files failure with array columns Core: Fix rewrite_position_delete_files failure with array/map columns Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rewrite_position_delete_files fails with ValidationException for tables with array columns

1 participant