You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by ti...@apache.org on 2009/12/21 23:07:52 UTC

svn commit: r893010 - in /incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery: functions/builtin-operators.xml xmlquery/query/XMLQueryTranslator.java

Author: tillw
Date: Mon Dec 21 22:07:52 2009
New Revision: 893010

URL: http://svn.apache.org/viewvc?rev=893010&view=rev
Log:
- added op:union (by putting together stuff that already existed)

Modified:
    incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions/builtin-operators.xml
    incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java

Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions/builtin-operators.xml
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions/builtin-operators.xml?rev=893010&r1=893009&r2=893010&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions/builtin-operators.xml (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/functions/builtin-operators.xml Mon Dec 21 22:07:52 2009
@@ -476,6 +476,9 @@
         <param name="parameter1" type="node()*"/>
         <param name="parameter2" type="node()*"/>
         <return type="node()*"/>
+        <!-- as we do the doc-order-sort and the duplicate elimination -->
+        <!-- after the concatenation, we can reuse the concat iterator -->
+        <runtime class="org.apache.vxquery.runtime.functions.ConcatenateIterator"/>
     </operator>
 
     <!-- op:yearMonthDuration-greater-than( $arg1 as xs:yearMonthDuration, $arg2 as xs:yearMonthDuration)  as xs:boolean -->

Modified: incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java?rev=893010&r1=893009&r2=893010&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java (original)
+++ incubator/vxquery/trunk/vxquery/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryTranslator.java Mon Dec 21 22:07:52 2009
@@ -732,7 +732,11 @@
                 Signature sign = operator.getSignature();
                 Expression arg1 = normalize(currCtx, translateExpression(ie.getLeftExpr()), sign.getParameterType(0));
                 Expression arg2 = normalize(currCtx, translateExpression(ie.getRightExpr()), sign.getParameterType(1));
-                return ExpressionBuilder.functionCall(currCtx, operator, arg1, arg2);
+                Expression result = ExpressionBuilder.functionCall(currCtx, operator, arg1, arg2);
+                if (BuiltinOperators.UNION.equals(operator)) {
+                    result = ExpressionBuilder.functionCall(currCtx, BuiltinOperators.SORT_DISTINCT_NODES_ASC, result);
+                }
+                return result;
             }
 
             case ENCLOSED_EXPRESSION: {