ConeyLiu commented on code in PR #3148:
URL: https://github.com/apache/parquet-java/pull/3148#discussion_r1945915331


##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileWriter.java:
##########
@@ -1150,8 +1150,11 @@ public void writeDataPageV2(
     int rlByteLength = toIntWithCheck(repetitionLevels.size(), "page 
repetition levels");
     int dlByteLength = toIntWithCheck(definitionLevels.size(), "page 
definition levels");
 
-    int compressedSize =
-        toIntWithCheck(compressedData.size() + repetitionLevels.size() + 
definitionLevels.size(), "page");
+    int compressedSize = 0;
+    if (compressedData.size() > 0) {
+      compressedSize =
+          toIntWithCheck(compressedData.size() + repetitionLevels.size() + 
definitionLevels.size(), "page");
+    }

Review Comment:
   `ParquetFileWriter` supports writing out pages directly. So there are some 
duplicate codes. I plan to reduce the duplication for better maintenance.



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