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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

GitBox
qiuchenjian 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_r250963140
 
 

 ##########
 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:
   i think (requestedSize / 100) * 30 cann't go out of range for int ,but requestedSize + ((requestedSize / 100) * 30) can
   if you consider the this.size is negative, i suggest to add a comment to explain this

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


With regards,
Apache Git Services