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


##########
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:
   Fixed in `63c4057df2` — the check is now per-snapshot via a new default 
`Snapshot#formatVersion()` that returns the 
`ManifestFile.LEGACY_FORMAT_VERSION` sentinel. v3-produced snapshots on a v3→v4 
upgraded table continue reporting the sentinel and keep `manifest_list` 
populated; only snapshots that override `formatVersion()` (v4+ writers, in a 
follow-up) trigger the adaptive branch.



##########
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:
   Added `TestSnapshotsTable` in `63c4057df2` covering both branches — a legacy 
snapshot (default `formatVersion()`) keeps `manifest_list` populated; an 
adaptive snapshot (overridden `formatVersion() == 4`) nulls it and populates 
`snapshot_file`.



##########
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:
   Removed in `63c4057df2`. Will reintroduce with the v4 code path that 
actually consumes it.



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