rdblue commented on code in PR #17523:
URL: https://github.com/apache/iceberg/pull/17523#discussion_r4554999352


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -372,6 +372,7 @@ public Snapshot apply() {
         summary(base),
         base.currentSchemaId(),
         manifestList.location(),
+        null /* rootManifest */,

Review Comment:
   Nit: This is not going to be re-wrapped, so I think there isn't a reason to 
use an inline comment instead of a line comment.



##########
core/src/test/java/org/apache/iceberg/TestRowLineageMetadata.java:
##########
@@ -70,40 +70,108 @@ public void cleanup() {
   public void testSnapshotRowIDValidation() {
     Snapshot snapshot =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", null, 
null, null);
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            null /* firstRowId */,
+            null /* addedRows */,
+            null /* keyId */);

Review Comment:
   Did this require reformatting the row? If not, then I'd leave it as-is to 
keep the change smaller.



##########
core/src/test/java/org/apache/iceberg/TestRowLineageMetadata.java:
##########
@@ -158,12 +250,34 @@ public void testInvalidSnapshotAddition() {
     // add rows to check TableMetadata validation; Snapshot rejects negative 
next-row-id
     Snapshot addRows =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "foo", 
base.nextRowId(), newRows, null);
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "foo" /* manifestListLocation */,
+            null /* rootManifest */,
+            base.nextRowId() /* firstRowId */,
+            newRows,
+            null /* keyId */);
     TableMetadata added = 
TableMetadata.buildFrom(base).addSnapshot(addRows).build();
 
     Snapshot invalidNewRows =
         new BaseSnapshot(
-            1, 2, 1L, 1, DataOperations.APPEND, null, 1, "foo", 
added.nextRowId() - 1, 10L, null);
+            1 /* sequenceNumber */,
+            2 /* snapshotId */,
+            1L /* parentId */,
+            1 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "foo" /* manifestListLocation */,
+            null /* rootManifest */,
+            added.nextRowId() - 1 /* firstRowId */,
+            10L /* addedRows */,
+            null /* keyId */);

Review Comment:
   I think all of this reformatting is not helpful. If it was to add the names, 
then it should be reverted. If it was already happening because the line was 
too long after adding `null, ` then it's fine.



##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -241,8 +241,8 @@ private static List<Snapshot> updatePathInSnapshots(
       TableMetadata metadata, String sourcePrefix, String targetPrefix) {
     List<Snapshot> newSnapshots = 
Lists.newArrayListWithCapacity(metadata.snapshots().size());
     for (Snapshot snapshot : metadata.snapshots()) {
-      String newManifestListLocation =

Review Comment:
   I don't think that is necessary. This is updating this method to fulfill its 
contract, not going down the rabbit hole of making relocation work in v4.



##########
core/src/test/java/org/apache/iceberg/TestSnapshot.java:
##########
@@ -34,22 +34,88 @@ public class TestSnapshot extends TestBase {
   public void snapshotValueMethodsIncludeMetadataFields() {
     Snapshot snapshot =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", 10L, 5L, 
"key-1");
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            10L /* firstRowId */,
+            5L /* addedRows */,
+            "key-1" /* keyId */);
     Snapshot same =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", 10L, 5L, 
"key-1");
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            10L /* firstRowId */,
+            5L /* addedRows */,
+            "key-1" /* keyId */);
     Snapshot differentFirstRowId =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", 11L, 5L, 
"key-1");
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            11L /* firstRowId */,
+            5L /* addedRows */,
+            "key-1" /* keyId */);
     Snapshot differentAddedRows =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", 10L, 6L, 
"key-1");
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            10L /* firstRowId */,
+            6L /* addedRows */,
+            "key-1" /* keyId */);
     Snapshot differentKeyId =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", 10L, 5L, 
"key-2");
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            10L /* firstRowId */,
+            5L /* addedRows */,
+            "key-2" /* keyId */);
     Snapshot withoutMetadataFields =
         new BaseSnapshot(
-            0, 1, null, 0, DataOperations.APPEND, null, 1, "ml.avro", null, 
null, null);
+            0 /* sequenceNumber */,
+            1 /* snapshotId */,
+            null /* parentId */,
+            0 /* timestampMillis */,
+            DataOperations.APPEND,
+            null /* summary */,
+            1 /* schemaId */,
+            "ml.avro" /* manifestListLocation */,
+            null /* rootManifest */,
+            null /* firstRowId */,
+            null /* addedRows */,
+            null /* keyId */);

Review Comment:
   Similar issue here. This is a lot of change for adding `null, `.



##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -241,8 +241,8 @@ private static List<Snapshot> updatePathInSnapshots(
       TableMetadata metadata, String sourcePrefix, String targetPrefix) {
     List<Snapshot> newSnapshots = 
Lists.newArrayListWithCapacity(metadata.snapshots().size());
     for (Snapshot snapshot : metadata.snapshots()) {
-      String newManifestListLocation =
-          newPath(snapshot.manifestListLocation(), sourcePrefix, targetPrefix);
+      String manifestList = snapshot.manifestListLocation();

Review Comment:
   I think it's reasonable to include this. This behavior is correct for this 
method's contract. We don't need to make the whole table rewrite work, but 
where we can update methods to fully implement their guarantees it seems like a 
good idea.



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