LuciferYang opened a new pull request, #10291:
URL: https://github.com/apache/paimon/pull/10291
### Purpose
Altering the element type (or element nullability) of a `MULTISET` column
threw a misleading `ColumnNotExistException`: the nested type-update walk in
`NestedSchemaUtils` had no `MULTISET` case, so an off-by-one routed the change
to `updateLastColumn` on an empty list. A `MULTISET<T>` is physically stored as
`InternalMap<T, Int>`, so the element is a map key, and the read-side cast
infrastructure (`SchemaEvolutionUtil`) has no MULTISET executor and
`createMapCastExecutor` deliberately forbids changing a map key type. So a
multiset element type change cannot be applied to existing data.
This rejects a multiset element modification at DDL time with a clear,
actionable message ("Cannot update the element type of MULTISET column ... a
multiset element is a map key, whose type cannot be evolved") instead of the
misleading `ColumnNotExistException`. The `MULTISET` column's own top-level
nullability change (the column, not its element) is unaffected and keeps
working.
This closes #10290.
### Tests
- `NestedSchemaUtilsTest` asserts that changing a multiset element type,
element nullability, or a complex multiset element is rejected with the clear
message (`testMultisetElementTypeChangeRejected`,
`...NullabilityChangeRejected`, `...OfComplexTypeRejected`).
- `testMultisetTypeUpdateNullability` pins that the multiset column's own
nullability change still applies.
### API and Format
No.
### Documentation
No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]