rdblue commented on a change in pull request #828: URL: https://github.com/apache/incubator-iceberg/pull/828#discussion_r420291519
########## File path: spark/src/main/java/org/apache/iceberg/spark/source/Reader.java ########## @@ -238,6 +279,46 @@ public Statistics estimateStatistics() { return new Stats(sizeInBytes, numRows); } + @Override + public boolean enableBatchRead() { + return lazyCheckEnableBatchRead(); + } + + private boolean lazyCheckEnableBatchRead() { + if (enableBatchRead == null) { + boolean allParquetFileScanTasks = + tasks().stream() + .allMatch(combinedScanTask -> !combinedScanTask.isDataTask() && combinedScanTask.files() + .stream() + .allMatch(fileScanTask -> fileScanTask.file().format().equals( + FileFormat.PARQUET))); + if (!allParquetFileScanTasks) { + this.enableBatchRead = false; + return false; Review comment: Why does this need to be efficient? I think that the primary concern should be readability here because this is executed at planning time and the result is cached. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org