Skip to content

[core] Clean up field-level options when dropping columns#7659

Open
qingwei727 wants to merge 1 commit intoapache:masterfrom
qingwei727:qingwei/fixDropColumn
Open

[core] Clean up field-level options when dropping columns#7659
qingwei727 wants to merge 1 commit intoapache:masterfrom
qingwei727:qingwei/fixDropColumn

Conversation

@qingwei727
Copy link
Copy Markdown
Contributor

@qingwei727 qingwei727 commented Apr 15, 2026

Purpose

Fix IllegalArgumentException: Field xxx can not be found in table schema when dropping a column that has field-level options (e.g. fields.xxx.default-value).

SchemaManager.generateTableSchema() removes the column from the field list but leaves its fields..* entries in options, causing SchemaValidation.validateFieldsPrefix() to fail. This fix removes those orphaned options during DropColumn processing.

Tests

SchemaManagerTest#testDropColumnCleansUpFieldOptions — creates a table with fields.extra_col.default-value, drops the column, and verifies both the column and its options are removed.

When dropping a column that has field-level options (e.g. fields.xxx.default-value),
SchemaValidation.validateFieldsPrefix() would fail because the options still reference
the dropped column. This fix removes fields.<droppedColumn>.* options during dropColumn
in SchemaManager.generateTableSchema().
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.

1 participant