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


##########
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:
   One more check I think we need here, if both are present they must match, 
currently the code just always uses sourceId if it's present even if sourceIds 
is also present and different.



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