You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2023/02/17 02:29:25 UTC

[GitHub] [parquet-mr] wgtmac commented on a diff in pull request #1031: PARQUET-2247: Fail-fast if CapacityByteArrayOutputStream write overflow

wgtmac commented on code in PR #1031:
URL: https://github.com/apache/parquet-mr/pull/1031#discussion_r1109219562


##########
parquet-common/src/main/java/org/apache/parquet/bytes/CapacityByteArrayOutputStream.java:
##########
@@ -220,6 +221,11 @@ public void write(byte b[], int off, int len) {
       currentSlabIndex += len;
       bytesUsed += len;
     }
+    if (bytesUsed < 0) {

Review Comment:
   Is it better to proactively check the overflow before addition?



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

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