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_r389133234
##########
File path: spark/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -305,61 +342,74 @@ public Statistics estimateStatistics() {
@Override
public String toString() {
return String.format(
- "IcebergScan(table=%s, type=%s, filters=%s, caseSensitive=%s)",
- table, lazySchema().asStruct(), filterExpressions, caseSensitive);
+ "IcebergScan(table=%s, type=%s, filters=%s, caseSensitive=%s,
batchedReads=%s)",
+ table, lazySchema().asStruct(), filterExpressions, caseSensitive,
enableBatchRead);
}
- private static class ReadTask implements InputPartition<InternalRow>,
Serializable {
- private final CombinedScanTask task;
+ @SuppressWarnings("checkstyle:VisibilityModifier")
+ private static class BaseReadTask implements Serializable {
+ final CombinedScanTask task;
private final String tableSchemaString;
private final String expectedSchemaString;
- private final Broadcast<FileIO> io;
- private final Broadcast<EncryptionManager> encryptionManager;
- private final boolean caseSensitive;
- private final boolean localityPreferred;
+ final Broadcast<FileIO> io;
+ final Broadcast<EncryptionManager> encryptionManager;
+ final boolean caseSensitive;
private transient Schema tableSchema = null;
private transient Schema expectedSchema = null;
- private transient String[] preferredLocations;
- private ReadTask(CombinedScanTask task, String tableSchemaString, String
expectedSchemaString,
- Broadcast<FileIO> io, Broadcast<EncryptionManager>
encryptionManager,
- boolean caseSensitive, boolean localityPreferred) {
+ BaseReadTask(CombinedScanTask task, String tableSchemaString, String
expectedSchemaString,
+ Broadcast<FileIO> io, Broadcast<EncryptionManager> encryptionManager,
+ boolean caseSensitive) {
this.task = task;
this.tableSchemaString = tableSchemaString;
this.expectedSchemaString = expectedSchemaString;
this.io = io;
this.encryptionManager = encryptionManager;
this.caseSensitive = caseSensitive;
- this.localityPreferred = localityPreferred;
- this.preferredLocations = getPreferredLocations();
}
- @Override
- public InputPartitionReader<InternalRow> createPartitionReader() {
- return new TaskDataReader(task, lazyTableSchema(), lazyExpectedSchema(),
io.value(),
- encryptionManager.value(), caseSensitive);
- }
-
- @Override
- public String[] preferredLocations() {
- return preferredLocations;
- }
-
- private Schema lazyTableSchema() {
+ Schema lazyTableSchema() {
if (tableSchema == null) {
this.tableSchema = SchemaParser.fromJson(tableSchemaString);
}
return tableSchema;
}
- private Schema lazyExpectedSchema() {
+ Schema lazyExpectedSchema() {
if (expectedSchema == null) {
this.expectedSchema = SchemaParser.fromJson(expectedSchemaString);
}
return expectedSchema;
}
+
Review comment:
Nit: unnecessary newline.
----------------------------------------------------------------
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]