From commits-return-25468-archive-asf-public=cust-asf.ponee.io@druid.apache.org Fri Sep 13 17:57:13 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 71093180652 for ; Fri, 13 Sep 2019 19:57:13 +0200 (CEST) Received: (qmail 42610 invoked by uid 500); 13 Sep 2019 17:57:12 -0000 Mailing-List: contact commits-help@druid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@druid.apache.org Delivered-To: mailing list commits@druid.apache.org Received: (qmail 42601 invoked by uid 99); 13 Sep 2019 17:57:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Sep 2019 17:57:12 +0000 From: GitBox To: commits@druid.apache.org Subject: [GitHub] [incubator-druid] ccaominh commented on a change in pull request #8535: fix caching bug with multi-column group-by Message-ID: <156839743274.18965.15288488576054062521.gitbox@gitbox.apache.org> Date: Fri, 13 Sep 2019 17:57:12 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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