rdblue commented on a change in pull request #828: iceberg-spark changes for 
vectorized reads
URL: https://github.com/apache/incubator-iceberg/pull/828#discussion_r389132135
 
 

 ##########
 File path: spark/src/main/java/org/apache/iceberg/spark/source/Reader.java
 ##########
 @@ -259,6 +259,43 @@ public Statistics estimateStatistics() {
     return new Stats(sizeInBytes, numRows);
   }
 
+  @Override
+  public boolean enableBatchRead() {
+    return lazyCheckEnableBatchRead();
+  }
+
+  private boolean lazyCheckEnableBatchRead() {
+    boolean allParquetFiles =
+            tasks().stream()
+                    .allMatch(combinedScanTask -> combinedScanTask.files()
+                            .stream()
+                            .allMatch(fileScanTask -> 
fileScanTask.file().format().equals(
+                                    FileFormat.PARQUET)));
+    if (!allParquetFiles) {
+      this.enableBatchRead = false;
+      return false;
+    }
 
 Review comment:
   Style: control flow statements should be followed by empty lines.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to