[
https://issues.apache.org/jira/browse/TAJO-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15001763#comment-15001763
]
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_r44625957
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/global/builder/DistinctGroupbyBuilder.java
---
@@ -250,17 +250,17 @@ private DistinctGroupbyNode
buildMultiLevelBaseDistinctGroupByNode(GlobalPlanCon
GroupbyNode eachGroupbyNode = buildInfo.getGroupbyNode();
List<AggregationFunctionCallEval> groupbyAggFunctions =
buildInfo.getAggFunctions();
- Target[] targets = new
Target[eachGroupbyNode.getGroupingColumns().length +
groupbyAggFunctions.size()];
- int targetIdx = 0;
+ List<Target> targets = new ArrayList<>();
for (Column column : eachGroupbyNode.getGroupingColumns()) {
Target target = new Target(new FieldEval(column));
- targets[targetIdx++] = target;
+ targets.add(target);
baseGroupByTargets.add(target);
}
for (Target eachAggFunctionTarget:
buildInfo.getAggFunctionTargets()) {
- targets[targetIdx++] = eachAggFunctionTarget;
+ targets.add(eachAggFunctionTarget);
--- 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)