jbonofre commented on code in PR #12897:
URL: https://github.com/apache/iceberg/pull/12897#discussion_r2061143410


##########
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:
   `source-id` and `source-ids` are exclusive, meaning that if `source-id` is 
present, `source-ids` should not be there, and if `source-ids` is present 
`source-id` should not be there.
   I'm adding a check to raise to check if not both are provided.



-- 
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

Reply via email to