Skip to content

fix(view): field ID preservation and error handling for RCK compatibility - #647

Merged
zeroshade merged 1 commit into
apache:mainfrom
shtripat:fix-view-issues
Dec 9, 2025
Merged

zeroshade merged 1 commit into
apache:mainfrom
shtripat:fix-view-issues

Conversation

@shtripat

@shtripat shtripat commented Dec 9, 2025 •

Copy link
Copy Markdown
Contributor
  1. Field ID Reassignment: NewMetadataWithUUID() was calling iceberg.AssignFreshSchemaIDs() which reassigned all field IDs starting from 1, breaking clients that expect their original field IDs to be preserved.
  2. Error Message Format: Duplicate dialect validation error wasn't wrapped with ErrInvalidViewMetadata and lacked proper capitalization, preventing MinIO from mapping it to IllegalArgumentException.
  3. Schema ID Handling: While MetadataBuilder.addSchema() already normalizes schema IDs to 0 for new views, the test expected consistent behavior across view version updates.

Problem it solves

Three RCK (REST Compatibility Kit) view tests were failing:

  1. basicCreateView / completeCreateView: Field ID mismatch
    expected: struct<3: id: required int, 4: data: required string>
    but was: struct<1: id: required int, 2: data: required string>
  2. createViewErrorCases: Incorrect error message format
    Expected: "Invalid view version: Cannot add multiple queries for dialect trino"
    Actual: "cannot add multiple queries for dialect trino"
  3. concurrentReplaceViewVersion: Schema ID not normalized
    expected: schemaId=0
    but was: schemaId=2

1. Field ID Reassignment: NewMetadataWithUUID() was calling iceberg.AssignFreshSchemaIDs()
which reassigned all field IDs starting from 1, breaking clients that expect their
original field IDs to be preserved.
2. Error Message Format: Duplicate dialect validation error wasn't wrapped with
ErrInvalidViewMetadata and lacked proper capitalization, preventing MinIO from mapping it to
IllegalArgumentException.
3. Schema ID Handling: While MetadataBuilder.addSchema() already normalizes schema
IDs to 0 for new views, the test expected consistent behavior across view version updates.

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
@zeroshade zeroshade changed the title Fix view field ID preservation and error handling for RCK compatibility fix(view): field ID preservation and error handling for RCK compatibility Dec 9, 2025
@zeroshade

Copy link
Copy Markdown
Member

Thanks!

@zeroshade
zeroshade merged commit c3d4bfc into apache:main Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants