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_r389134051
##########
File path: spark/src/main/java/org/apache/iceberg/spark/source/Reader.java
##########
@@ -383,286 +433,23 @@ private Schema lazyExpectedSchema() {
}
}
- private static class TaskDataReader implements
InputPartitionReader<InternalRow> {
- // for some reason, the apply method can't be called from Java without
reflection
- private static final DynMethods.UnboundMethod APPLY_PROJECTION =
DynMethods.builder("apply")
- .impl(UnsafeProjection.class, InternalRow.class)
- .build();
-
- private final Iterator<FileScanTask> tasks;
- private final Schema tableSchema;
- private final Schema expectedSchema;
- private final FileIO fileIo;
- private final Map<String, InputFile> inputFiles;
- private final boolean caseSensitive;
-
- private Iterator<InternalRow> currentIterator = null;
- private Closeable currentCloseable = null;
- private InternalRow current = null;
-
- TaskDataReader(CombinedScanTask task, Schema tableSchema, Schema
expectedSchema, FileIO fileIo,
- EncryptionManager encryptionManager, boolean caseSensitive)
{
- this.fileIo = fileIo;
- this.tasks = task.files().iterator();
- this.tableSchema = tableSchema;
- this.expectedSchema = expectedSchema;
- Iterable<InputFile> decryptedFiles =
encryptionManager.decrypt(Iterables.transform(task.files(),
- fileScanTask ->
- EncryptedFiles.encryptedInput(
-
this.fileIo.newInputFile(fileScanTask.file().path().toString()),
- fileScanTask.file().keyMetadata())));
- ImmutableMap.Builder<String, InputFile> inputFileBuilder =
ImmutableMap.builder();
- decryptedFiles.forEach(decrypted ->
inputFileBuilder.put(decrypted.location(), decrypted));
- this.inputFiles = inputFileBuilder.build();
- // open last because the schemas and fileIo must be set
- this.currentIterator = open(tasks.next());
- this.caseSensitive = caseSensitive;
- }
+ /**
+ * Organizes input data into [InputPartition]s for Vectorized
[ColumnarBatch] reads
+ */
+ private static class ColumnarBatchReadTask extends BaseReadTask implements
InputPartition<ColumnarBatch> {
Review comment:
Why doesn't this support preferred locations?
----------------------------------------------------------------
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]