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


##########
core/src/main/java/org/apache/iceberg/SnapshotsTable.java:
##########
@@ -94,13 +97,16 @@ public CloseableIterable<FileScanTask> planFiles() {
     }
   }
 
-  private static StaticDataTask.Row snapshotToRow(Snapshot snap) {
+  private static StaticDataTask.Row snapshotToRow(Snapshot snap, int 
formatVersion) {
+    boolean adaptive = formatVersion >= 
TableMetadata.MIN_FORMAT_VERSION_ADAPTIVE_MANIFEST_TREE;

Review Comment:
   A tree upgraded from v3 to v4 would have adaptive `true` at the table level, 
but there could be snapshots that are v3 produced snapshots. How do we handle 
it correctly? It seems a bit tricky. 



##########
core/src/main/java/org/apache/iceberg/BaseSnapshotFile.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.io.Serializable;
+import java.nio.ByteBuffer;
+import org.apache.iceberg.encryption.EncryptionManager;
+import org.apache.iceberg.encryption.EncryptionUtil;
+
+class BaseSnapshotFile implements SnapshotFile, Serializable {

Review Comment:
   This is not used anywhere yet?



##########
api/src/main/java/org/apache/iceberg/SnapshotFile.java:
##########
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg;
+
+import java.nio.ByteBuffer;
+import org.apache.iceberg.encryption.EncryptionManager;
+
+/**
+ * The top-level file that a {@link Snapshot} points at. For v3 and earlier 
this is a manifest list
+ * (see {@link ManifestListFile}); for v4+ it is a root manifest carrying a 
mix of data-file entries

Review Comment:
   I prefer something like `ContentRoot` - this is self explanatory and also 
applies to previous manifest list files also. 



##########
core/src/main/java/org/apache/iceberg/SnapshotsTable.java:
##########
@@ -94,13 +97,16 @@ public CloseableIterable<FileScanTask> planFiles() {
     }
   }
 
-  private static StaticDataTask.Row snapshotToRow(Snapshot snap) {
+  private static StaticDataTask.Row snapshotToRow(Snapshot snap, int 
formatVersion) {
+    boolean adaptive = formatVersion >= 
TableMetadata.MIN_FORMAT_VERSION_ADAPTIVE_MANIFEST_TREE;
+    String location = snap.snapshotFileLocation();
     return StaticDataTask.Row.of(
         snap.timestampMillis() * 1000,
         snap.snapshotId(),
         snap.parentId(),
         snap.operation(),
-        snap.manifestListLocation(),
-        snap.summary());
+        adaptive ? null : location,

Review Comment:
   We might be missing tests for the adaptive being true branch?



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