gaborkaszab commented on code in PR #18481:
URL: https://github.com/apache/iceberg/pull/18481#discussion_r4281263988
##########
data/src/main/java/org/apache/iceberg/data/GenericDeleteFilter.java:
##########
@@ -18,20 +18,29 @@
*/
package org.apache.iceberg.data;
+import java.util.function.Function;
import org.apache.iceberg.FileScanTask;
import org.apache.iceberg.Schema;
import org.apache.iceberg.StructLike;
import org.apache.iceberg.io.FileIO;
import org.apache.iceberg.io.InputFile;
public class GenericDeleteFilter extends DeleteFilter<Record> {
- private final FileIO io;
+ private final Function<String, InputFile> inputFiles;
Review Comment:
Renamed
##########
data/src/main/java/org/apache/iceberg/data/GenericReader.java:
##########
@@ -32,41 +34,38 @@
import org.apache.iceberg.io.CloseableGroup;
import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.io.CloseableIterator;
-import org.apache.iceberg.io.FileIO;
-import org.apache.iceberg.io.InputFile;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
import org.apache.iceberg.util.PartitionUtil;
class GenericReader implements Serializable {
- private final FileIO io;
+ private final EncryptingFileIO io;
Review Comment:
It's easier to pass it to
`InputFilesDecryptor.fromTasks(Iterable<FileScanTask>, EncryptingFileIO)` this
way, rather than checking+casting when we call that function.
##########
data/src/main/java/org/apache/iceberg/data/GenericReader.java:
##########
@@ -84,13 +83,15 @@ private CloseableIterable<Record> applyResidual(
return records;
}
- private CloseableIterable<Record> openFile(FileScanTask task, Schema
fileProjection) {
- InputFile input = io.newInputFile(task.file());
+ private CloseableIterable<Record> openFile(
+ FileScanTask task, Schema fileProjection, InputFilesDecryptor decryptor)
{
Map<Integer, ?> partition =
PartitionUtil.constantsMap(task,
IdentityPartitionConverters::convertConstant);
ReadBuilder<Record, ?> builder =
- FormatModelRegistry.readBuilder(task.file().format(), Record.class,
input);
+ FormatModelRegistry.readBuilder(
+ task.file().format(), Record.class,
decryptor.getInputFile(task.file().location()));
Review Comment:
The `InputFilesDecryptor` used here goes through
`EncryptingFileIO.bulkDecrypt()` that in turn creates `InputFile`s passing the
size too.
I also checked putting a breakpoint at `AesGcmInputStream` creation and we
have a length there. Is this what you meant?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]