You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/07/30 04:01:56 UTC

[GitHub] leventov commented on a change in pull request #6062: Fix a bug in GroupByQueryEngine

leventov commented on a change in pull request #6062: Fix a bug in GroupByQueryEngine
URL: https://github.com/apache/incubator-druid/pull/6062#discussion_r206010426
 
 

 ##########
 File path: processing/src/main/java/io/druid/query/groupby/GroupByQueryEngine.java
 ##########
 @@ -178,37 +178,33 @@ public int getNumRows()
       return positions;
     }
 
-    private List<ByteBuffer> updateValues(
-        ByteBuffer key,
-        List<DimensionSelector> dims
-    )
+    @Nullable
+    private List<ByteBuffer> updateValues(ByteBuffer key, List<DimensionSelector> dims)
     {
       if (dims.size() > 0) {
-        List<ByteBuffer> retVal = null;
-        List<ByteBuffer> unaggregatedBuffers = null;
-
         final DimensionSelector dimSelector = dims.get(0);
         final IndexedInts row = dimSelector.getRow();
         final int rowSize = row.size();
         if (rowSize == 0) {
           ByteBuffer newKey = key.duplicate();
           newKey.putInt(MISSING_VALUE);
-          unaggregatedBuffers = updateValues(newKey, dims.subList(1, dims.size()));
+          return updateValues(newKey, dims.subList(1, dims.size()));
         } else {
+          List<ByteBuffer> retVal = null;
           for (int i = 0; i < rowSize; i++) {
             ByteBuffer newKey = key.duplicate();
             int dimValue = row.get(i);
             newKey.putInt(dimValue);
-            unaggregatedBuffers = updateValues(newKey, dims.subList(1, dims.size()));
-          }
-        }
-        if (unaggregatedBuffers != null) {
-          if (retVal == null) {
-            retVal = Lists.newArrayList();
+            List<ByteBuffer> unaggregatedBuffers = updateValues(newKey, dims.subList(1, dims.size()));
 
 Review comment:
   This class could be improved in a lot of ways but I don't want to spend time on that because it's legacy and should probably never be used today.
   
   @jihoonson or @jon-wei is that correct? If yes, do you plan to remove groupBy v1?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org