cashmand commented on code in PR #3212:
URL: https://github.com/apache/parquet-java/pull/3212#discussion_r2098869810


##########
parquet-variant/src/main/java/org/apache/parquet/variant/VariantUtil.java:
##########
@@ -807,4 +808,44 @@ static String getMetadataKey(ByteBuffer metadata, int id) {
       return new String(metadataArray);
     }
   }
+
+  /**
+   * Returns a map from each string to its ID in the Variant metadata.
+   * @param metadata The Variant metadata
+   * @return A map from metadata key to its position.
+   */
+  static HashMap<String, Integer> getMetadataMap(ByteBuffer metadata) {
+    int pos = metadata.position();
+    checkIndex(pos, metadata.limit());

Review Comment:
   I believe it's possible for position to equal limit (i.e. no byte can be 
read).



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