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 2019/09/13 17:57:12 UTC

[GitHub] [incubator-druid] ccaominh commented on a change in pull request #8535: fix caching bug with multi-column group-by

ccaominh commented on a change in pull request #8535: fix caching bug with multi-column group-by
URL: https://github.com/apache/incubator-druid/pull/8535#discussion_r324301668
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java
 ##########
 @@ -639,7 +639,7 @@ public ResultRow apply(Object input)
 
               // Must convert generic Jackson-deserialized type into the proper type.
               resultRow.set(
-                  dimensionStart + dimPos,
+                  dimensionStart + dimPos++,
 
 Review comment:
   The increment operation can be hard to notice as it's embedded within the argument to a function call. Some alternatives that may improve readability:
   
   ```java
   resultRow.set(
       dimensionStart + dimPos,
       DimensionHandlerUtils.convertObjectToType(results.next(), dimensionSpec.getOutputType())
   );
   dimPos++;
   ```
   
   or changing the while-loop to a for-loop (which also has the nice effect of reducing the scope of `dimPos`):
   
   ```java
   for (int dimPos = 0; dimsIter.hasNext() && results.hasNext(); dimPos++) {
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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