Skip to content

Conversation

@Gezi-lzq
Copy link
Contributor

  • Enhanced handling of nested fields: Added logic to recursively process removed and changed fields within structs, struct lists, and struct maps, ensuring schema changes are detected for all nested structures. [1] [2]

  • Corrected construction of MAKE_OPTIONAL schema changes: Now passes null for the type when marking a field as optional during soft removal, ensuring correct change representation.

  • Refactored field change detection: Streamlined logic for adding columns, making fields optional, and promoting types.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances schema change handling in the Iceberg table management system by adding support for nested field changes within complex structures (structs, lists, and maps), while fixing critical issues in schema evolution logic.

Key Changes:

  • Fixed MAKE_OPTIONAL schema change construction to pass null for non-primitive types instead of incorrectly calling asPrimitiveType()
  • Added recursive processing for removed and changed fields in struct lists and struct maps
  • Refactored field change detection logic into smaller, more focused methods

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
IcebergTableManager.java Core fix for MAKE_OPTIONAL handling; added methods isStructList, isStructMap, collectRemovedStructFields, and collectStructFieldChanges to recursively handle nested structures
IcebergWriterSchemaEvolutionTest.java Comprehensive integration tests covering nested struct evolution, collection element changes, field additions/removals, and type promotions across multiple schema versions
IcebergTableManagerTest.java Refactored unit tests with clearer naming and added tests for nested field operations, flush handling, and edge cases
IcebergSchemaChangeCollectorTest.java New dedicated test suite for schema change detection logic covering all types of changes (additions, removals, promotions, optional conversions) at various nesting levels

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Gezi-lzq Gezi-lzq force-pushed the feat/schema-evolution branch from 5d89372 to 45bd7dd Compare November 19, 2025 02:19
@Gezi-lzq Gezi-lzq force-pushed the feat/schema-evolution branch from 45bd7dd to ed96711 Compare November 19, 2025 02:23
@superhx superhx merged commit a9f6faf into main Nov 19, 2025
6 checks passed
@superhx superhx deleted the feat/schema-evolution branch November 19, 2025 02:52
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.

3 participants