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


##########
core/src/main/java/org/apache/iceberg/PartitionSpecParser.java:
##########
@@ -132,15 +144,37 @@ 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);
 
-      // partition field ids are missing in old PartitionSpec, they always 
auto-increment from
-      // PARTITION_DATA_ID_START
-      if (element.has(FIELD_ID)) {
-        builder.addField(transform, sourceId, JsonUtil.getInt(FIELD_ID, 
element), name);
-        fieldIdCount++;
+      if (element.has(SOURCE_IDS)) {

Review Comment:
   I think we should at least warn here if source id is also present and has a 
different value. I could also see throwing an exception but we generally don't 
fail unless we absolutely have to when parsing. As long as the writer would 
override the bad source-id I think we are ok



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

Reply via email to