rdblue commented on code in PR #11415:
URL: https://github.com/apache/iceberg/pull/11415#discussion_r1893403467


##########
core/src/test/java/org/apache/iceberg/variants/TestShreddedObject.java:
##########
@@ -0,0 +1,446 @@
+/*
+ * 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.variants;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
+import org.apache.iceberg.relocated.com.google.common.collect.Maps;
+import org.apache.iceberg.relocated.com.google.common.collect.Sets;
+import org.apache.iceberg.util.DateTimeUtil;
+import org.apache.iceberg.util.Pair;
+import org.apache.iceberg.util.RandomUtil;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+public class TestShreddedObject {
+  private static final Map<String, VariantValue> FIELDS =
+      ImmutableMap.of(
+          "a",
+          Variants.of(34),
+          "b",
+          Variants.of("iceberg"),
+          "c",
+          Variants.of(new BigDecimal("12.21")));

Review Comment:
   What cases do you have in mind?
   
   The tests here aren't intended to be exhaustive for the types that could be 
in the shredded fields. They just demonstrate the behavior between shredded and 
unshredded fields. For an object within a `ShreddedObject`, there are two 
cases. If it is not shredded, then it will be handled by the wrapped 
`SerializedObject`. And if it is shredded then it will be added to a 
`ShreddedObject` using `put` to place it in the shredded map. In both cases, 
we're just relying on the behavior of other classes to hold another 
`SerializedObject` or `ShreddedObject`, so I'm not sure what we would test that 
isn't already tested by the primitives here.



-- 
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]

Reply via email to