jasonf20 commented on code in PR #10962:
URL: https://github.com/apache/iceberg/pull/10962#discussion_r1746659034


##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -833,7 +833,17 @@ public List<ManifestFile> apply(TableMetadata base, 
Snapshot snapshot) {
         filterManager.filterManifests(
             SnapshotUtil.schemaFor(base, targetBranch()),
             snapshot != null ? snapshot.dataManifests(ops.io()) : null);
-    long minDataSequenceNumber =
+
+    long minNewFileSequenceNumber =
+        addedDataFiles().stream()
+            .filter(x -> x.dataSequenceNumber() != null && 
x.dataSequenceNumber() >= 0)
+            .mapToLong(ContentFile::dataSequenceNumber)
+            .reduce(
+                newDataFilesDataSequenceNumber != null
+                    ? newDataFilesDataSequenceNumber
+                    : base.nextSequenceNumber(),
+                Math::min);

Review Comment:
   Currently _I think_ ('m also not 100% sure) you are right as there isn't an 
API that would allow setting a specific data file to a SN smaller than 
`newDataFilesDataSequenceNumber`. But I think that's just a side affect of the 
current operations inheriting from `MergingSnapshotProducer`. A new inheritor 
of `MergingSnapshotProducer` could simply be using `minNewDataSequenceNumber` 
as a default and pass in files with explicit SNs on top. 



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to