pvary commented on code in PR #14652:
URL: https://github.com/apache/iceberg/pull/14652#discussion_r2580318709


##########
spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/source/BaseBatchReader.java:
##########
@@ -67,17 +75,27 @@ protected CloseableIterable<ColumnarBatch> newBatchIterable(
       Expression residual,
       Map<Integer, ?> idToConstant,
       SparkDeleteFilter deleteFilter) {
+    CloseableIterable<ColumnarBatch> iterable;
     switch (format) {
       case PARQUET:
-        return newParquetIterable(inputFile, start, length, residual, 
idToConstant, deleteFilter);
-
+        iterable =
+            newParquetIterable(
+                inputFile,
+                start,
+                length,
+                residual,
+                idToConstant,
+                deleteFilter != null ? deleteFilter.requiredSchema() : 
expectedSchema());
+        break;
       case ORC:
-        return newOrcIterable(inputFile, start, length, residual, 
idToConstant);
-
+        iterable = newOrcIterable(inputFile, start, length, residual, 
idToConstant);
+        break;
       default:
         throw new UnsupportedOperationException(
             "Format: " + format + " not supported for batched reads");
     }
+
+    return CloseableIterable.transform(iterable, new 
BatchDeleteFilter(deleteFilter)::filterBatch);

Review Comment:
   No problem. Sometimes we have to revisit previous decisions.
   
   Reverted the ORC changes for now.



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