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


##########
api/src/main/java/org/apache/iceberg/Schema.java:
##########
@@ -603,20 +626,33 @@ private List<NestedField> reassignIds(List<NestedField> 
columns, TypeUtil.GetID
     if (getID == null) {
       return columns;
     }
-    Type res =
-        TypeUtil.assignIds(
-            StructType.of(columns),
-            oldId -> {
-              int newId = getID.get(oldId);
-              if (newId != oldId) {
-                idsToReassigned.put(oldId, newId);
-                idsToOriginal.put(newId, oldId);
-              }
-              return newId;
-            });
+
+    TypeUtil.GetID tracked =

Review Comment:
   Actually looking back I don't think we should do anything here yet. The 
string version may load, but it's actually *also* broken and failing silently.
   
   ```java
   @TestTemplate
   public void rowColumnWithPartitionFieldIdIsReadBack() throws IOException {
     assumeThat(formatVersion).as("Only V2 delete files store the deleted 
row").isEqualTo(2);
     String tableName = "row_column_with_partition_field_id";
     Schema schema =
         new Schema(
             Types.NestedField.required(1, "id", Types.IntegerType.get()),
             Types.NestedField.optional(1000, "name", Types.StringType.get()));
     Table tab =
         createTable(tableName, schema, 
PartitionSpec.builderFor(schema).identity("id").build());
     TableOperations ops = ((HasTableOperations) tab).operations();
     ops.commit(
         ops.current(),
         TableMetadata.buildFrom(ops.current())
             .setCurrentSchema(schema, schema.highestFieldId())
             .build());
     tab.refresh();
     assertThat(tab.schema().findField("name").fieldId())
         .isEqualTo(tab.spec().fields().get(0).fieldId());
     List<PositionDelete<?>> deletes =
         ImmutableList.of(positionDelete(tab.schema(), "/data.parquet", 0L, 1, 
"alice"));
     DeleteFile posDeletes =
         FileHelpers.testOnlyPosDeleteFileWithRow(
             tab,
             Files.localOutput(File.createTempFile("junit", null, 
temp.toFile())),
             TestHelpers.Row.of(1),
             posDeleteRecords(tab, deletes));
     tab.newRowDelta().addDeletes(posDeletes).commit();
     List<Object[]> actual =
         rowsToJava(
             spark
                 .read()
                 .format("iceberg")
                 .load(catalogName + ".default." + tableName + 
".position_deletes")
                 .select("row.id", "row.name")
                 .collectAsList());
     assertThat(actual).containsExactly(row(1, "alice"));
     dropTable(tableName);
   }
   ```
   
   This test with gives
   ```
   Expecting actual:
     [[1, null]]
   to contain exactly (and in same order):
     [[1, "alice"]]
   ```
   
   I tried cleaning up the message but this is completely broken atm so we can 
fix that somewhere else. 
   



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