etseidl commented on code in PR #3124:
URL: https://github.com/apache/parquet-java/pull/3124#discussion_r1920464511


##########
parquet-column/src/main/java/org/apache/parquet/column/statistics/SizeStatistics.java:
##########
@@ -67,8 +67,16 @@ public static class Builder {
     private Builder(PrimitiveType type, int maxRepetitionLevel, int 
maxDefinitionLevel) {
       this.type = type;
       this.unencodedByteArrayDataBytes = 0L;
-      repetitionLevelHistogram = new long[maxRepetitionLevel + 1];
-      definitionLevelHistogram = new long[maxDefinitionLevel + 1];
+      if (maxRepetitionLevel > 0) {
+        repetitionLevelHistogram = new long[maxRepetitionLevel + 1];
+      } else {
+        repetitionLevelHistogram = new long[0]; // omitted
+      }
+      if (maxDefinitionLevel > 1) {

Review Comment:
   I'm curious why you've chosen 1 here, when other implementations use 0. Is 
it so parquet-java will implement the spec exactly or are you thinking to 
minimize metadata size? Not a criticism, just genuinely curious. 



-- 
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...@parquet.apache.org

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


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

Reply via email to