KazydubB commented on a change in pull request #1641: DRILL-4858: 
REPEATED_COUNT on an array of maps and an array of arrays is not implemented
URL: https://github.com/apache/drill/pull/1641#discussion_r257188407
 
 

 ##########
 File path: 
exec/vector/src/main/java/org/apache/drill/exec/vector/complex/impl/RepeatedListReaderImpl.java
 ##########
 @@ -80,7 +79,10 @@ public void reset() {
 
   @Override
   public int size() {
-    return maxOffset - currentOffset;
+    if (currentOffset == NO_VALUES) {
+      return 0;
+    }
+    return maxOffset - currentOffset - 1;
 
 Review comment:
   Not sure whether this `isNull()` is actually needed. In 
`ReapetedMapReaderImpl` it is used in `SingleLikeRepeatedMapReaderImpl` (to 
check if it `isSet()`) which has  `ReapetedMapReaderImpl` as delegate.
   
   Regarding using ternary operator - it is OK, but I find current 
implementation cleaner (with respect to readability), because second value 
(`maxOffset - currentOffset - 1`) uses 3 operands.

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