manuzhang opened a new pull request, #16528:
URL: https://github.com/apache/iceberg/pull/16528
### Motivation
The v3 spec requires `unknown` to be promotable to any primitive type. Java
did not include that rule in `TypeUtil.isPromotionAllowed`, which blocked
schema evolution and read-compatibility paths that should allow `unknown`
columns to become concrete primitive columns.
### Description
- Add an `UNKNOWN` case to `TypeUtil.isPromotionAllowed` so `unknown` can be
promoted to primitive target types.
- Add a read-compatibility test that verifies `unknown` to `int` is allowed
while `unknown` to struct, list, and map remains rejected.
- Add a schema evolution test that verifies
`SchemaUpdate.updateColumn("unk", Types.IntegerType.get())` succeeds when the
current type is `unknown`.
### Testing
- `./gradlew :iceberg-api:spotlessJavaCheck`
- `./gradlew :iceberg-core:spotlessJavaCheck`
- `./gradlew :iceberg-api:test --tests
org.apache.iceberg.types.TestReadabilityChecks`
- `./gradlew :iceberg-core:test --tests org.apache.iceberg.TestSchemaUpdate`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]