aokolnychyi commented on code in PR #9384:
URL: https://github.com/apache/iceberg/pull/9384#discussion_r1439572133


##########
core/src/main/java/org/apache/iceberg/io/ClusteredPositionDeleteWriter.java:
##########
@@ -46,17 +49,39 @@ public ClusteredPositionDeleteWriter(
       OutputFileFactory fileFactory,
       FileIO io,
       long targetFileSizeInBytes) {
+    this(writerFactory, fileFactory, io, targetFileSizeInBytes, 
DeleteGranularity.PARTITION);
+  }
+
+  public ClusteredPositionDeleteWriter(
+      FileWriterFactory<T> writerFactory,
+      OutputFileFactory fileFactory,
+      FileIO io,
+      long targetFileSizeInBytes,
+      DeleteGranularity granularity) {
     this.writerFactory = writerFactory;
     this.fileFactory = fileFactory;
     this.io = io;
     this.targetFileSizeInBytes = targetFileSizeInBytes;
+    this.granularity = granularity;
     this.deleteFiles = Lists.newArrayList();
     this.referencedDataFiles = CharSequenceSet.empty();
   }
 
   @Override
   protected FileWriter<PositionDelete<T>, DeleteWriteResult> newWriter(
       PartitionSpec spec, StructLike partition) {
+    switch (granularity) {
+      case FILE:
+        return new TargetedPositionDeleteWriter<>(() -> newRollingWriter(spec, 
partition));

Review Comment:
   We can actually roll correctly here because this is the "clustered" path. We 
are not going to use the sorting writer and will not buffer deletes. We can 
also roll correctly in the "fanout" path cause the sorting writer acts as a 
wrapper on top of the rolling writer.



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