Abhishek-Gawande opened a new pull request, #17672: URL: https://github.com/apache/iceberg/pull/17672
Fixes #17324 ### What changes were proposed in this pull request? This PR adds support for `TypeID.UNKNOWN` in `SingleValueParser`, fixing an issue where the REST catalog's `/plan` endpoint can fail with a truncated `HTTP 200 OK` response. ### Why are the changes needed? When a partition field references a column that is subsequently dropped from the table schema, `PartitionSpec.resultType()` falls back to `Types.UnknownType.get()`. However, when `ContentFileParser` serializes the data file's partition values, `SingleValueParser.toJson()` does not handle `UNKNOWN` and throws an `UnsupportedOperationException`. This can occur while the JSON response is being streamed, resulting in a partially written response when serialization fails. ### How was this patch tested? * Added `TestSingleValueParser.unknownTypeRoundTrip` to verify that `UnknownType` correctly handles nulls, integer values serialized as strings, and string values. * Added `TestContentFileParser.partitionSerializationWithDroppedSourceColumn` to reproduce the issue by simulating a dropped source column, re-binding the historical partition spec, and verifying that the partition data can be serialized and deserialized successfully. * Verified locally with `./gradlew :iceberg-core:test`. * Ran `./gradlew spotlessApply`. -- 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]
