Fokko commented on code in PR #3562:
URL: https://github.com/apache/parquet-java/pull/3562#discussion_r3313482746
##########
parquet-variant/src/test/java/org/apache/parquet/variant/VariantTestUtil.java:
##########
@@ -35,11 +37,12 @@ public class VariantTestUtil {
/** Random number generator for generating random strings */
private static SecureRandom random = new SecureRandom(new byte[] {1, 2, 3,
4, 5});
- static final ByteBuffer EMPTY_METADATA = ByteBuffer.wrap(new byte[] {0b1});
+ // version=1, offsetSize=1, dictSize=0, single end-offset=0 — minimum
well-formed empty metadata
+ static final ByteBuffer EMPTY_METADATA = ByteBuffer.wrap(new byte[] {0b1,
0x00, 0x00});
Review Comment:
I assume that we don't accept the single byte anymore? Should we still allow
that, or make it explicit to the users?
##########
parquet-variant/src/main/java/org/apache/parquet/variant/Variant.java:
##########
@@ -108,16 +110,23 @@ public Variant(ByteBuffer value, ByteBuffer metadata) {
this.dictSize = 0;
}
this.metadataCache = null;
+ VariantUtil.validateValueShallow(this.value, dictSize);
Review Comment:
Since we now validate in the constructor, should we add some Javadoc to this
public function? Including the `@throws IllegalArgumentException`
--
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]