Fokko commented on code in PR #11868:
URL: https://github.com/apache/iceberg/pull/11868#discussion_r2179441376
##########
core/src/main/java/org/apache/iceberg/PartitionSpecParser.java:
##########
@@ -68,7 +68,7 @@ public static String toJson(UnboundPartitionSpec spec,
boolean pretty) {
}
public static PartitionSpec fromJson(Schema schema, JsonNode json) {
- return fromJson(json).bind(schema);
+ return fromJson(json).bindUnchecked(schema);
Review Comment:
The change to `buildUnchecked` is required because of a check that was added
not long ago: https://github.com/apache/iceberg/pull/12887, where someone was
previously allowed to create an invalid partition spec.
I've updated the code. Let me know what you think. If we don't want to use
`buildUnchecked`, then we need three variations:
- `buildStrict` when a new `PartitionSpec` is added, we want to make sure
that all the fields are there
- `build` with allowing missing fields for the inactive specs that contain
fields that are dropped.
- `bindUnchecked` when we don't want to perform checks at all
--
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]