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

    https://github.com/apache/drill/pull/81#discussion_r35816854
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/BaseRepeatedValueVector.java
 ---
    @@ -100,7 +100,7 @@ public void setInitialCapacity(int numRecords) {
     
       @Override
       public int getValueCapacity() {
    -    final int offsetValueCapacity = offsets.getValueCapacity() - 1;
    +    final int offsetValueCapacity = Math.max(offsets.getValueCapacity() - 
1, 0);
    --- End diff --
    
    Small comment, but there are two patterns used to handle special zero cases 
in the vector code. The one I have seen is actually for a slightly different 
case, the example copied below is out of the VarCharVector.setValueCount(int) 
method. It might be worth making the pattern consistent by using the ternary 
operator for both of these cases, so the fact that they are distinct is more 
obvious. This might seem a little contradictory, having them look totally 
different might be better. However, on first glance I thought this was a 
different way to express the same concept.
    
    valueCount == 0 ? 0 : valueCount+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to