Github user vrozov commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1090#discussion_r162771968
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java
 ---
    @@ -31,8 +31,9 @@
       private int length;
     
       public SelectionVector4(ByteBuf vector, int recordCount, int 
batchRecordCount) throws SchemaChangeException {
    -    if (recordCount > Integer.MAX_VALUE /4) {
    -      throw new SchemaChangeException(String.format("Currently, Drill can 
only support allocations up to 2gb in size.  You requested an allocation of %d 
bytes.", recordCount * 4));
    +    if (recordCount > Integer.MAX_VALUE / 4) {
    +      throw new SchemaChangeException(String.format("Currently, Drill can 
only support allocations up to 2gb in size. " +
    +          "You requested an allocation of %d bytes.", recordCount * 4));
    --- End diff --
    
    My understanding is that Java will use `int` to compute `recordCount * 4` 
and overflow.


---

Reply via email to