Skip to content

Conversation

@Prajwal-banakar
Copy link
Contributor

Purpose

Linked issue: close #2344

The purpose of this change is to refactor the SchemaUpdate class to delegate all schema membership management (columns, primary keys, and auto-increment fields) directly to Schema.Builder. Currently, SchemaUpdate manually maintains these members, which is error-prone and can lead to broken schemas during evolution.

Brief change log

Refactored SchemaUpdate: Removed local lists for columns, primary keys, and auto-increment fields.

Builder Delegation: Modified SchemaUpdate to directly maintain a Schema.Builder instance, ensuring a single source of truth for schema building and validation logic.

Enhanced Schema.Builder: Updated Schema.Builder#fromSchema to correctly adopt all members from an existing schema, including column IDs and metadata.

Added Helper API: Added Schema.Builder#getColumn(String columnName) to allow checking for existing columns within the builder's state.

Tests

Verified the fix by running TableSchemaTest and SchemaUpdateTest to ensure the delegation logic handles schema evolution correctly without IllegalStateException.

Performed a full test suite execution for the fluss-common module: mvn test -pl fluss-common.

Results: 1,491 tests run, 0 failures.

API and Format

This change adds a public helper method getColumn(String columnName) to the Schema.Builder API.

It does not affect the storage format.

Documentation

This change does not introduce a new feature; it is a refactoring of existing internal logic.

@Prajwal-banakar Prajwal-banakar force-pushed the schemaupdate-delegation branch from 5da4435 to f10a940 Compare January 20, 2026 12:48
@Prajwal-banakar Prajwal-banakar changed the title [common] Refactor SchemaUpdate to delegate schema changes to Schema.Builder [coordinator] Refactor SchemaUpdate to delegate schema changes to Schema.Builder Jan 20, 2026
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.

Use Schema.Builder#fromSchema in SchemaUpdate

1 participant