asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in hyracks[master]: Fix for ASTERIXDB-1291: deals with the case that a NTS' data...
Date Tue, 09 Feb 2016 19:41:22 GMT
Yingyi Bu has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/622

Change subject: Fix for ASTERIXDB-1291: deals with the case that a NTS' data source operator
has been deep copied.
......................................................................

Fix for ASTERIXDB-1291: deals with the case that a NTS' data source operator has been deep
copied.

Change-Id: Ie3efa74e38bbfa9eee4a20e4a9cf6fc2a5840973
---
M algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/LogicalOperatorDeepCopyWithNewVariablesVisitor.java
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/hyracks refs/changes/22/622/1

diff --git a/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/LogicalOperatorDeepCopyWithNewVariablesVisitor.java
b/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/LogicalOperatorDeepCopyWithNewVariablesVisitor.java
index 2a92ead..b3f6639 100644
--- a/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/LogicalOperatorDeepCopyWithNewVariablesVisitor.java
+++ b/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/logical/visitors/LogicalOperatorDeepCopyWithNewVariablesVisitor.java
@@ -117,7 +117,12 @@
         dest.getAnnotations().putAll(src.getAnnotations());
     }
 
-    public ILogicalOperator deepCopy(ILogicalOperator op, ILogicalOperator arg) throws AlgebricksException
{
+    public ILogicalOperator deepCopy(ILogicalOperator op) throws AlgebricksException {
+        // The deep copy call outside this visitor always has a null argument.
+        return deepCopy(op, null);
+    }
+
+    private ILogicalOperator deepCopy(ILogicalOperator op, ILogicalOperator arg) throws AlgebricksException
{
         ILogicalOperator opCopy = op.accept(this, arg);
         OperatorManipulationUtil.computeTypeEnvironmentBottomUp(opCopy, context);
         return opCopy;
@@ -308,8 +313,8 @@
         List<ILogicalPlan> nestedPlansCopy = new ArrayList<ILogicalPlan>();
 
         GroupByOperator opCopy = new GroupByOperator(groupByListCopy, decorListCopy, nestedPlansCopy);
-        deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
         deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy);
+        deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
         return opCopy;
     }
 
@@ -348,7 +353,9 @@
     @Override
     public ILogicalOperator visitNestedTupleSourceOperator(NestedTupleSourceOperator op,
ILogicalOperator arg)
             throws AlgebricksException {
-        NestedTupleSourceOperator opCopy = new NestedTupleSourceOperator(op.getDataSourceReference());
+        Mutable<ILogicalOperator> dataSourceReference = arg == null ? op.getDataSourceReference()
+                : new MutableObject<ILogicalOperator>(arg);
+        NestedTupleSourceOperator opCopy = new NestedTupleSourceOperator(dataSourceReference);
         deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy);
         return opCopy;
     }
@@ -423,8 +430,8 @@
     public ILogicalOperator visitSubplanOperator(SubplanOperator op, ILogicalOperator arg)
throws AlgebricksException {
         List<ILogicalPlan> nestedPlansCopy = new ArrayList<ILogicalPlan>();
         SubplanOperator opCopy = new SubplanOperator(nestedPlansCopy);
-        deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
         deepCopyInputsAnnotationsAndExecutionMode(op, arg, opCopy);
+        deepCopyPlanList(op.getNestedPlans(), nestedPlansCopy, opCopy);
         return opCopy;
     }
 

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/622
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3efa74e38bbfa9eee4a20e4a9cf6fc2a5840973
Gerrit-PatchSet: 1
Gerrit-Project: hyracks
Gerrit-Branch: master
Gerrit-Owner: Yingyi Bu <buyingyi@gmail.com>

Mime
View raw message