You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2013/12/07 03:29:19 UTC
svn commit: r1548781 -
/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java
Author: prestonc
Date: Sat Dec 7 02:29:19 2013
New Revision: 1548781
URL: http://svn.apache.org/r1548781
Log:
Found a better method of replacing operator's input.
Modified:
incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java
Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java?rev=1548781&r1=1548780&r2=1548781&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java (original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertAssignToUnnestRule.java Sat Dec 7 02:29:19 2013
@@ -82,7 +82,7 @@ public class ConvertAssignToUnnestRule i
}
AssignOperator assign = (AssignOperator) op2;
- // Check to see if the expression is a child function.
+ // Check to see if the expression has an unnesting implementation.
ILogicalExpression logicalExpression2 = (ILogicalExpression) assign.getExpressions().get(0).getValue();
if (logicalExpression2.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) {
return false;
@@ -96,11 +96,9 @@ public class ConvertAssignToUnnestRule i
// TODO add checks for variables used that have now been removed.
// Update the unnest parameters.
- int index = 0;
- for (Mutable<ILogicalOperator> input : assign.getInputs()) {
- unnest.getInputs().get(index++).setValue(input.getValue());
- }
-
+ unnest.getInputs().clear();
+ unnest.getInputs().addAll(assign.getInputs());
+
UnnestingFunctionCallExpression child = new UnnestingFunctionCallExpression(functionInfo2, functionCall2.getArguments());
unnest.getExpressionRef().setValue(child);