rdblue commented on code in PR #9384: URL: https://github.com/apache/iceberg/pull/9384#discussion_r1439063090
########## 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: This doesn't need to use rolling writers, right? The sorting writer won't ever roll because its length is `0L` until it is closed. -- 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