[ 
https://issues.apache.org/jira/browse/TAJO-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15001766#comment-15001766
 ] 

ASF GitHub Bot commented on TAJO-1946:
--------------------------------------

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

    https://github.com/apache/tajo/pull/839#discussion_r44626040
  
    --- Diff: 
tajo-core/src/main/java/org/apache/tajo/engine/planner/global/builder/DistinctGroupbyBuilder.java
 ---
    @@ -437,14 +436,12 @@ private DistinctGroupbyNode 
buildBaseDistinctGroupByNode(GlobalPlanContext conte
           // finally this aggregation output tuple's order is GROUP_BY_COL1, 
COL2, .... + AGG_VALUE, SUM_VALUE, ...
           GroupbyNode otherGroupbyNode = new 
GroupbyNode(context.getPlan().getLogicalPlan().newPID());
     
    -      Target[] targets = new Target[originalGroupingColumns.size() + 
otherAggregationFunctionTargets.size()];
    -      int targetIdx = 0;
    +      List<Target> targets = new ArrayList<>();
           for (Column column : originalGroupingColumns) {
    -        Target target = new Target(new FieldEval(column));
    -        targets[targetIdx++] = target;
    +        targets.add(new Target(new FieldEval(column)));
           }
           for (Target eachTarget : otherAggregationFunctionTargets) {
    -        targets[targetIdx++] = eachTarget;
    +        targets.add(eachTarget);
    --- End diff --
    
    You can simply use ```addAll()```.


> Change Projectable::setTargets and getTargets to set and get List<Target>
> -------------------------------------------------------------------------
>
>                 Key: TAJO-1946
>                 URL: https://issues.apache.org/jira/browse/TAJO-1946
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: Planner/Optimizer
>            Reporter: Hyunsik Choi
>            Assignee: Dongkyu Hwangbo
>            Priority: Minor
>              Labels: newbie
>
> See TAJO-1938. It would simplify lots of codes for 'for-loop' on Targets if 
> we change {{Projectable::setTargets}} and {{getTargets}} to set and get 
> {{List<Target>}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to