commit | 8b664f3d018c7af1661d75ad017f7034a1f9ee95 | [log] [tgz] |
---|---|---|
author | Taewoo Kim <wangsaeu@yahoo.com> | Wed Oct 12 20:31:52 2016 -0700 |
committer | Taewoo Kim <wangsaeu@yahoo.com> | Wed Oct 12 22:24:37 2016 -0700 |
tree | 1fcacfcd4b8bb59ec798ea7c80a0ab2efa23c950 | |
parent | e65a57ab27a92670f9ef42d188c1b62a11fe765d [diff] |
Fixed UsedVariableVisitor for the Splitoperator - The used variables of SplitOperator and ReplicateOperator now don't include the used variables from their output(s). Change-Id: Iae861c1339cf00c5a53aa2b5b5b14113ec53484b Reviewed-on: https://asterix-gerrit.ics.uci.edu/1273 Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/UsedVariableVisitor.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/UsedVariableVisitor.java index cfe2a37..3daa00f 100644 --- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/UsedVariableVisitor.java +++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/UsedVariableVisitor.java
@@ -428,17 +428,12 @@ @Override public Void visitReplicateOperator(ReplicateOperator op, Void arg) throws AlgebricksException { - for (Mutable<ILogicalOperator> outputOp : op.getOutputs()) { - VariableUtilities.getUsedVariables(outputOp.getValue(), usedVariables); - } return null; } @Override public Void visitSplitOperator(SplitOperator op, Void arg) throws AlgebricksException { - for (Mutable<ILogicalOperator> outputOp : op.getOutputs()) { - VariableUtilities.getUsedVariables(outputOp.getValue(), usedVariables); - } + op.getBranchingExpression().getValue().getUsedVariables(usedVariables); return null; }
diff --git a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/RemoveUnusedAssignAndAggregateRule.java b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/RemoveUnusedAssignAndAggregateRule.java index 55831f0..5bf4e6881 100644 --- a/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/RemoveUnusedAssignAndAggregateRule.java +++ b/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/RemoveUnusedAssignAndAggregateRule.java
@@ -383,7 +383,7 @@ // We may have visited this operator before if there are multiple // paths in the plan. if (accumulatedUsedVarFromRootMap.containsKey(opRef)) { - accumulatedUsedVarFromRootMap.get(opRef).addAll(usedVarsSetInThisOp); + accumulatedUsedVarFromRootMap.get(opRef).addAll(accumulatedUsedVarFromRootSet); } else { accumulatedUsedVarFromRootMap.put(opRef, new HashSet<LogicalVariable>(accumulatedUsedVarFromRootSet)); }