asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [65/85] [abbrv] incubator-asterixdb-hyracks git commit: Fix issue 562.
Date Fri, 24 Apr 2015 18:46:32 GMT
Fix issue 562.

Change-Id: I2ce52bbed0ef98f965816f296303c7a21e2b148c
Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/202
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Pouria Pirzadeh <pouria.pirzadeh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/commit/e1413cc9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/tree/e1413cc9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/diff/e1413cc9

Branch: refs/heads/master
Commit: e1413cc9aa3d824f07637d5b3604e6fb524f04b6
Parents: 7527bbb
Author: buyingyi <buyingyi@gmail.com>
Authored: Thu Jan 15 10:30:42 2015 -0800
Committer: Ian Maxon <imaxon@uci.edu>
Committed: Fri Jan 16 09:28:15 2015 -0800

----------------------------------------------------------------------
 .../AbstractIntroduceGroupByCombinerRule.java   |  6 ++---
 .../rules/RemoveRedundantVariablesRule.java     | 23 ++++++--------------
 2 files changed, 10 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/e1413cc9/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/AbstractIntroduceGroupByCombinerRule.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/AbstractIntroduceGroupByCombinerRule.java
b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/AbstractIntroduceGroupByCombinerRule.java
index 93f181f..b60c80d 100644
--- a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/AbstractIntroduceGroupByCombinerRule.java
+++ b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/AbstractIntroduceGroupByCombinerRule.java
@@ -77,9 +77,9 @@ public abstract class AbstractIntroduceGroupByCombinerRule extends AbstractIntro
             // usedDecorVars should always contain only one variable.
             p.second.getValue().getUsedVariables(usedDecorVars);
             if (!newGbyLiveVars.contains(usedDecorVars.get(0))) {
-                LogicalVariable newDecorVar = context.newVar();
-                newGbyOp.addDecorExpression(newDecorVar, p.second.getValue());
-                p.second.setValue(new VariableReferenceExpression(newDecorVar));
+                // Let the left-hand side of gbyOp's decoration expressions populated through
the combiner group-by without
+                // any intermediate assignment.
+                newGbyOp.addDecorExpression(null, p.second.getValue());
             }
         }
         newGbyOp.setExecutionMode(ExecutionMode.LOCAL);

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/e1413cc9/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/RemoveRedundantVariablesRule.java
----------------------------------------------------------------------
diff --git a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/RemoveRedundantVariablesRule.java
b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/RemoveRedundantVariablesRule.java
index c34a52f..8b1aeb4 100644
--- a/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/RemoveRedundantVariablesRule.java
+++ b/algebricks/algebricks-rewriter/src/main/java/edu/uci/ics/hyracks/algebricks/rewriter/rules/RemoveRedundantVariablesRule.java
@@ -68,19 +68,12 @@ public class RemoveRedundantVariablesRule implements IAlgebraicRewriteRule
{
     private final VariableSubstitutionVisitor substVisitor = new VariableSubstitutionVisitor();
     private final Map<LogicalVariable, List<LogicalVariable>> equivalentVarsMap
= new HashMap<LogicalVariable, List<LogicalVariable>>();
 
-    protected boolean hasRun = false;
-
-    @Override
-    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext
context) {
-        return false;
-    }
-
     @Override
-    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext
context) throws AlgebricksException {
+    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext
context)
+            throws AlgebricksException {
         if (context.checkIfInDontApplySet(this, opRef.getValue())) {
             return false;
         }
-        equivalentVarsMap.clear();
         boolean modified = removeRedundantVariables(opRef, context);
         if (modified) {
             context.computeAndSetTypeEnvironmentForOperator(opRef.getValue());
@@ -88,6 +81,11 @@ public class RemoveRedundantVariablesRule implements IAlgebraicRewriteRule
{
         return modified;
     }
 
+    @Override
+    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext
context) throws AlgebricksException {
+        return false;
+    }
+
     private void updateEquivalenceClassMap(LogicalVariable lhs, LogicalVariable rhs) {
         List<LogicalVariable> equivalentVars = equivalentVarsMap.get(rhs);
         if (equivalentVars == null) {
@@ -106,13 +104,6 @@ public class RemoveRedundantVariablesRule implements IAlgebraicRewriteRule
{
         AbstractLogicalOperator op = (AbstractLogicalOperator) opRef.getValue();
         boolean modified = false;
 
-        // Recurse into children.
-        for (Mutable<ILogicalOperator> inputOpRef : op.getInputs()) {
-            if (removeRedundantVariables(inputOpRef, context)) {
-                modified = true;
-            }
-        }
-
         // Update equivalence class map.
         if (op.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
             AssignOperator assignOp = (AssignOperator) op;


Mime
View raw message