[
https://issues.apache.org/jira/browse/TAJO-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15006749#comment-15006749
]
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_r44932832
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
---
@@ -1322,14 +1317,16 @@ public LogicalNode
visitTableSubQuery(GlobalPlanContext context, LogicalPlan pla
if (eachNode.getPID() == leftMostSubQueryNode.getPID()) {
continue;
}
- Target[] eachNodeTargets = eachNode.getTargets();
- if (eachNodeTargets.length != targetMappings.length) {
+ List<Target> eachNodeTargets = eachNode.getTargets();
+ if (eachNodeTargets.size() != targetMappings.length) {
throw new TajoInternalError("Union query can't have
different number of target columns.");
}
- for (int i = 0; i < eachNodeTargets.length; i++) {
+ for (int i = 0; i < eachNodeTargets.size(); i++) {
Column inColumn =
eachNode.getInSchema().getColumn(targetMappings[i]);
-
eachNodeTargets[i].setAlias(eachNodeTargets[i].getNamedColumn().getQualifiedName());
- EvalNode evalNode = eachNodeTargets[i].getEvalTree();
+ Target t = eachNodeTargets.get(i);
+ t.setAlias(t.getNamedColumn().getQualifiedName());
+ eachNodeTargets.set(i, t);
--- End diff --
This line seems to be unnecessary.
> 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)