gaborkaszab commented on code in PR #18486:
URL: https://github.com/apache/iceberg/pull/18486#discussion_r4467735402
##########
core/src/main/java/org/apache/iceberg/encryption/InputFilesDecryptor.java:
##########
@@ -71,13 +75,28 @@ private Map<String, InputFile> inputFiles() {
return lazyInputFiles;
}
- private static Collection<ContentFile<?>>
referencedFiles(Iterable<FileScanTask> tasks) {
+ private static Collection<ContentFile<?>> referencedFiles(Iterable<? extends
ScanTask> tasks) {
Map<String, ContentFile<?>> files = Maps.newHashMap();
- for (FileScanTask task : tasks) {
- files.put(task.file().location(), task.file());
- for (DeleteFile delete : task.deletes()) {
- files.put(delete.location(), delete);
+ for (ScanTask task : tasks) {
Review Comment:
Did have a discussion on this with @pvary : It's not really sophisticated to
have such a switch on the exact type of the `ScanTask` here. We believe that
the `ScanTask` implementations themselves should be able to tell us, what are
their referenced files if there are any. That would be the right level of
abstraction.
As an implementation what we have in mind is to have some interface like
`HasReferencedFiles` with a single function `referencedFiles()` returning a
collection of `ContentFile`s.
Then here in the decryptor we can iterate the list of `ScanTasks` verify
that they implement the new interface (throw if not) and ask them to give us
their referenced files.
--
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]