jbonofre commented on code in PR #12897: URL: https://github.com/apache/iceberg/pull/12897#discussion_r2061155133
########## core/src/main/java/org/apache/iceberg/PartitionSpecParser.java: ########## @@ -132,15 +147,29 @@ private static void buildFromJsonFields(UnboundPartitionSpec.Builder builder, Js String name = JsonUtil.getString(NAME, element); String transform = JsonUtil.getString(TRANSFORM, element); - int sourceId = JsonUtil.getInt(SOURCE_ID, element); + Preconditions.checkArgument( + element.has(SOURCE_ID) || element.has(SOURCE_IDS), + "Cannot parse partition field, either " + + SOURCE_ID + + " or " + + SOURCE_IDS + + " has to be present"); Review Comment: I added a check to guarantee we only have `source-id` or `source-ids`, not both (and I added a corresponding test for that). -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org