You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/25 11:52:23 UTC

[GitHub] shardul-cr7 commented on a change in pull request #3104: [HOTFIX] Fix select query on varchar column with large data fails with jvm crash

shardul-cr7 commented on a change in pull request #3104: [HOTFIX] Fix select query on varchar column with large data fails with jvm crash
URL: https://github.com/apache/carbondata/pull/3104#discussion_r250958984
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datastore/ReusableDataBuffer.java
 ##########
 @@ -47,7 +47,8 @@
    */
   public byte[] getDataBuffer(int requestedSize) {
     if (dataBuffer == null || requestedSize > size) {
-      this.size = requestedSize + ((requestedSize * 30) / 100);
+      this.size = requestedSize + ((requestedSize / 100) * 30);
 
 Review comment:
   No. We can't change the requested size. If we change the requested_size like 
   ```requestedSize = requestedSize + ((requestedSize / 100) * 30) ``` 
   we might get a size lesser than the original requested size because (requestedSize / 100) * 30 can go out of range for int which will return a negative value.
   So we need to compare Original requested size and new size.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services