RussellSpitzer commented on code in PR #13284:
URL: https://github.com/apache/iceberg/pull/13284#discussion_r2138539891


##########
api/src/test/java/org/apache/iceberg/variants/TestSerializedArray.java:
##########
@@ -100,16 +100,22 @@ public void testStringDifferentLengths() {
     assertThat(array.numElements()).isEqualTo(6);
     assertThat(array.get(0).type()).isEqualTo(PhysicalType.STRING);
     assertThat(array.get(0).asPrimitive().get()).isEqualTo("a");
+    assertThat(array.get(0).asPrimitive().sizeInBytes()).isEqualTo(2);

Review Comment:
   A few interesting things we can do here, Checking the size is great but we 
can also assert that the class here is a 
   SerializedShortString.
   
   May make sense to have something like
   ```java
   assertVariantString(VariantValue value, String expected) {
      assert physical type
      assert contents equal
      if expected.length < maxShortString
         assert class is SerilaizedShortString
         assert length 1 + expected.length
      else
         assert class is SerializedPrimitive
         assert length 5 + expected.length
   }
   ```



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