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

 ##########
 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:
   @shardul-cr7 I think @xuchuanyin has a point. If the intention is to 
increase the size by 30 % of the requested size then we should increase it even 
in case of requestedSize is less than 100. I feel these can be handled by 
assigning the value t double and after calculation, we can typecast to int 
would solve the issue.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to