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


##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -137,14 +140,24 @@ public static StructLikeSet toEqualitySet(
 
   public static <T extends StructLike> PositionDeleteIndex toPositionIndex(
       CharSequence dataLocation, List<CloseableIterable<T>> deleteFiles) {
+    return toPositionIndex(dataLocation, deleteFiles, 
ThreadPools.getDeleteWorkerPool());
+  }
+
+  public static <T extends StructLike> PositionDeleteIndex toPositionIndex(
+      CharSequence dataLocation,
+      List<CloseableIterable<T>> deleteFiles,
+      ExecutorService deletePosThreadPool) {
     DataFileFilter<T> locationFilter = new DataFileFilter<>(dataLocation);
     List<CloseableIterable<Long>> positions =
         Lists.transform(
             deleteFiles,
             deletes ->
                 CloseableIterable.transform(
                     locationFilter.filter(deletes), row -> (Long) 
POSITION_ACCESSOR.get(row)));
-    return toPositionIndex(CloseableIterable.concat(positions));
+    return toPositionIndex(
+        (positions.size() > 1 && (deletePosThreadPool != null))

Review Comment:
   I find this ternary operator hard to read. Can we switch to an explicit if 
else statement?



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