wypoon commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r856700831


##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -226,17 +261,18 @@ private CloseableIterable<T> 
applyPosDeletes(CloseableIterable<T> records) {
 
     // if there are fewer deletes than a reasonable number to keep in memory, 
use a set
     if (posDeletes.stream().mapToLong(DeleteFile::recordCount).sum() < 
setFilterThreshold) {
-      return Deletes.filter(records, this::pos, 
Deletes.toPositionIndex(filePath, deletes));
+      return Deletes.filter(records, this::pos, 
Deletes.toPositionIndex(filePath, deletes, counter));
     }
 
-    return Deletes.streamingFilter(records, this::pos, 
Deletes.deletePositions(filePath, deletes));
+    return Deletes.streamingFilter(records, this::pos, 
Deletes.deletePositions(filePath, deletes), counter);
   }
 
   private CloseableIterable<Record> openPosDeletes(DeleteFile file) {
     return openDeletes(file, POS_DELETE_SCHEMA);
   }
 
   private CloseableIterable<Record> openDeletes(DeleteFile deleteFile, Schema 
deleteSchema) {
+    LOG.trace("opening delete file {}", deleteFile.path());

Review Comment:
   Done.



##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/BatchDataReader.java:
##########
@@ -47,24 +48,34 @@
 import org.apache.spark.rdd.InputFileBlockHolder;
 import org.apache.spark.sql.catalyst.InternalRow;
 import org.apache.spark.sql.vectorized.ColumnarBatch;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 class BatchDataReader extends BaseDataReader<ColumnarBatch> {
+  private static final Logger LOG = 
LoggerFactory.getLogger(BatchDataReader.class);
   private final Schema expectedSchema;
   private final String nameMapping;
   private final boolean caseSensitive;
   private final int batchSize;
+  private final DeleteCounter counter;
 
   BatchDataReader(CombinedScanTask task, Table table, Schema expectedSchema, 
boolean caseSensitive, int size) {
     super(table, task);
     this.expectedSchema = expectedSchema;
     this.nameMapping = 
table.properties().get(TableProperties.DEFAULT_NAME_MAPPING);
     this.caseSensitive = caseSensitive;
     this.batchSize = size;
+    this.counter = new DeleteCounter();
+  }
+
+  protected DeleteCounter counter() {
+    return counter;
   }
 
   @Override
   CloseableIterator<ColumnarBatch> open(FileScanTask task) {
     DataFile file = task.file();
+    LOG.debug("opening data file {}", file.path());

Review Comment:
   Done.



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