aokolnychyi commented on code in PR #6309: URL: https://github.com/apache/iceberg/pull/6309#discussion_r1035023768
########## spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/source/SparkBatch.java: ########## @@ -95,43 +96,61 @@ public PartitionReaderFactory createReaderFactory() { } private int batchSize() { - if (parquetOnly() && parquetBatchReadsEnabled()) { + if (useParquetBatchReads()) { return readConf.parquetBatchSize(); - } else if (orcOnly() && orcBatchReadsEnabled()) { + } else if (useOrcBatchReads()) { return readConf.orcBatchSize(); } else { return 0; } } - private boolean parquetOnly() { - return taskGroups.stream() - .allMatch(task -> !task.isDataTask() && onlyFileFormat(task, FileFormat.PARQUET)); - } - - private boolean parquetBatchReadsEnabled() { + // conditions for using Parquet batch reads: + // - Parquet vectorization is enabled + // - at least one column is projected + // - only primitives are projected + // - all tasks are of FileScanTask type and read only Parquet files + private boolean useParquetBatchReads() { return readConf.parquetVectorizationEnabled() - && // vectorization enabled Review Comment: Spotless formatted these comments in a weird way so moved them into the comment. -- 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