ggershinsky commented on code in PR #8252:
URL: https://github.com/apache/iceberg/pull/8252#discussion_r1523712418


##########
core/src/test/java/org/apache/iceberg/TestManifestEncryption.java:
##########
@@ -0,0 +1,247 @@
+/*
+ * 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;
+
+import static org.apache.iceberg.types.Types.NestedField.required;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import org.apache.avro.InvalidAvroMagicException;
+import org.apache.iceberg.encryption.EncryptedOutputFile;
+import org.apache.iceberg.encryption.EncryptingFileIO;
+import org.apache.iceberg.encryption.EncryptionManager;
+import org.apache.iceberg.encryption.EncryptionTestHelpers;
+import org.apache.iceberg.encryption.PlaintextEncryptionManager;
+import org.apache.iceberg.exceptions.RuntimeIOException;
+import org.apache.iceberg.io.CloseableIterable;
+import org.apache.iceberg.io.FileIO;
+import org.apache.iceberg.io.OutputFile;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.iceberg.types.Conversions;
+import org.apache.iceberg.types.Types;
+import org.assertj.core.api.Assertions;
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+public class TestManifestEncryption {
+  private static final FileIO FILE_IO = new TestTables.LocalFileIO();
+
+  private static final Schema SCHEMA =
+      new Schema(
+          required(1, "id", Types.LongType.get()),
+          required(2, "timestamp", Types.TimestampType.withZone()),
+          required(3, "category", Types.StringType.get()),
+          required(4, "data", Types.StringType.get()),
+          required(5, "double", Types.DoubleType.get()));
+
+  private static final PartitionSpec SPEC =
+      PartitionSpec.builderFor(SCHEMA)
+          .identity("category")
+          .hour("timestamp")
+          .bucket("id", 16)
+          .build();
+
+  private static final long SNAPSHOT_ID = 987134631982734L;
+  private static final String PATH =
+      
"s3://bucket/table/category=cheesy/timestamp_hour=10/id_bucket=3/file.avro";
+  private static final FileFormat FORMAT = FileFormat.AVRO;
+  private static final PartitionData PARTITION =
+      DataFiles.data(SPEC, "category=cheesy/timestamp_hour=10/id_bucket=3");
+  private static final Metrics METRICS =
+      new Metrics(
+          1587L,
+          ImmutableMap.of(1, 15L, 2, 122L, 3, 4021L, 4, 9411L, 5, 15L), // 
sizes
+          ImmutableMap.of(1, 100L, 2, 100L, 3, 100L, 4, 100L, 5, 100L), // 
value counts
+          ImmutableMap.of(1, 0L, 2, 0L, 3, 0L, 4, 0L, 5, 0L), // null value 
counts
+          ImmutableMap.of(5, 10L), // nan value counts
+          ImmutableMap.of(1, Conversions.toByteBuffer(Types.IntegerType.get(), 
1)), // lower bounds
+          ImmutableMap.of(1, Conversions.toByteBuffer(Types.IntegerType.get(), 
1))); // upper bounds
+  private static final List<Long> OFFSETS = ImmutableList.of(4L);
+  private static final Integer SORT_ORDER_ID = 2;
+
+  private static final ByteBuffer CONTENT_KEY_METADATA = 
ByteBuffer.allocate(100);
+
+  private static final DataFile DATA_FILE =
+      new GenericDataFile(
+          0,

Review Comment:
   Sounds good, I'll fix this in the next patch.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to