mxm commented on code in PR #19121:
URL: https://github.com/apache/iceberg/pull/19121#discussion_r4683187449
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertReader.java:
##########
@@ -152,7 +154,8 @@ private void processDataFile(
throws IOException {
ContentFile<?> file = task.file();
Schema readSchema = appendRowPosition(keySchema);
- PositionDeleteIndex existingDeletes = loadExistingDVs(task,
file.location());
+ InputFilesDecryptor decryptor =
InputFilesDecryptor.fromTasks(List.of(task), encryptingIO);
Review Comment:
Do we need `InputFilesDecryptor` here?
`encryptingIO.newInputFile(task.file())` and keeping the `deleteLoader` field
with `deleteFile -> encryptingIO.newInputFile(deleteFile)` should decrypt the
same files, like previously.
##########
flink/v2.3/flink/src/test/java/org/apache/iceberg/flink/maintenance/operator/TestEqualityConvertReaderEncryption.java:
##########
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iceberg.flink.maintenance.operator;
+
+import static org.apache.iceberg.types.Types.NestedField.optional;
+import static org.apache.iceberg.types.Types.NestedField.required;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+import org.apache.flink.streaming.util.OneInputStreamOperatorTestHarness;
+import org.apache.flink.streaming.util.ProcessFunctionTestHarnesses;
+import org.apache.iceberg.DataFile;
+import org.apache.iceberg.DeleteFile;
+import org.apache.iceberg.FileFormat;
+import org.apache.iceberg.Files;
+import org.apache.iceberg.Parameter;
+import org.apache.iceberg.ParameterizedTestExtension;
+import org.apache.iceberg.Parameters;
+import org.apache.iceberg.PartitionSpec;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.TableProperties;
+import org.apache.iceberg.TestTables;
+import org.apache.iceberg.data.FileHelpers;
+import org.apache.iceberg.data.GenericRecord;
+import org.apache.iceberg.data.Record;
+import org.apache.iceberg.encryption.EncryptionTestHelpers;
+import org.apache.iceberg.flink.TableLoader;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.types.Types;
+import org.apache.iceberg.util.Pair;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.io.TempDir;
+
+@ExtendWith(ParameterizedTestExtension.class)
+class TestEqualityConvertReaderEncryption {
Review Comment:
Makes sense.
##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertReader.java:
##########
@@ -107,7 +109,7 @@ public void open(OpenContext openContext) throws Exception {
eqFieldIds);
fieldSerializer = new StructLikeSerializer();
keyWrapper = new InternalRecordWrapper(keySchema.asStruct());
- deleteLoader = new BaseDeleteLoader(deleteFile ->
table.io().newInputFile(deleteFile));
+ encryptingIO = EncryptingFileIO.combine(table.io(), table.encryption());
Review Comment:
Why don't we use:
```suggestion
encryptingIO = EncryptingFileIO.combine(table.io(), table.encryption());
deleteLoader = new BaseDeleteLoader(deleteFile ->
encryptingIO.newInputFile(deleteFile));
```
--
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]