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 2015/06/28 20:30:42 UTC

[01/11] vxquery git commit: doc rewrite rule test

Repository: vxquery
Updated Branches:
  refs/heads/master aeaa2f1f9 -> c849b88a7


doc rewrite rule test


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/3e62dbe5
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/3e62dbe5
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/3e62dbe5

Branch: refs/heads/master
Commit: 3e62dbe5de2ab88891f9b939c263995b45e54470
Parents: 169e71a
Author: Shivani Mall <sm...@ucr.edu>
Authored: Mon Jun 22 12:20:54 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Mon Jun 22 12:20:54 2015 -0700

----------------------------------------------------------------------
 .../compiler/rewriter/RewriteRuleset.java       |   2 +
 .../rules/ConvertDocExpressionToFile.java       | 180 +++++++++++++++++++
 .../EliminateUnnestAggregateSubplanRule.java    |   3 +-
 .../rewriter/rules/util/ExpressionToolbox.java  |   1 -
 .../rewriter/rules/util/OperatorToolbox.java    |   3 +
 .../metadata/VXQueryMetadataProvider.java       |   2 +-
 vxquery-xtest/src/test/resources/DocTest.xml    |  47 +++++
 .../ExpectedTestResults/Simple/US000000001.xml  |  17 ++
 .../ExpectedTestResults/Simple/test.xml         |   1 +
 .../resources/Queries/XQuery/Simple/test.xq     |  19 ++
 .../src/test/resources/VXQueryCatalog.xml       |  20 ++-
 .../src/test/resources/cat/SingleQuery.xml      |   2 -
 .../src/test/resources/cat/TestRewriteRules.xml |  28 +++
 13 files changed, 316 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
index b67402b..3648f2f 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
@@ -21,6 +21,7 @@ import java.util.List;
 
 import org.apache.vxquery.compiler.rewriter.rules.ConsolidateAssignAggregateRule;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertAssignToUnnestRule;
+import org.apache.vxquery.compiler.rewriter.rules.ConvertDocExpressionToFile;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertFromAlgebricksExpressionsRule;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertToAlgebricksExpressionsRule;
 import org.apache.vxquery.compiler.rewriter.rules.EliminateSubplanForSingleItemsRule;
@@ -116,6 +117,7 @@ public class RewriteRuleset {
         normalization.add(new IntroduceCollectionRule());
         normalization.add(new RemoveUnusedAssignAndAggregateRule());
 
+        normalization.add(new ConvertDocExpressionToFile());
         // Adds child steps to the data source scan.
         // TODO Replace consolidate with a new child function that takes multiple paths.
         //        normalization.add(new ConsolidateUnnestsRule());

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
new file mode 100644
index 0000000..c64157f
--- /dev/null
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.vxquery.compiler.rewriter.rules;
+
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.vxquery.compiler.algebricks.VXQueryConstantValue;
+import org.apache.vxquery.compiler.rewriter.rules.util.ExpressionToolbox;
+import org.apache.vxquery.compiler.rewriter.rules.util.OperatorToolbox;
+import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
+import org.apache.vxquery.datamodel.builders.atomic.StringValueBuilder;
+import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.functions.BuiltinFunctions;
+import org.apache.vxquery.metadata.VXQueryMetadataProvider;
+import org.apache.vxquery.types.BuiltinTypeRegistry;
+import org.apache.vxquery.types.Quantifier;
+import org.apache.vxquery.types.SequenceType;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+
+/**
+ * The rule searches for where the function_doc1 function is in the plan in place of XQuery function.
+ * It replaces the string contained in the function with its absolute file path.
+ * 
+ * <pre>
+ * Before
+ * 
+ *   plan__parent
+ *   %OPERATOR( $v1 : function_doc1( \@string ) )
+ *   plan__child
+ *   
+ *   Where xquery_function creates an atomic value.
+ *   
+ * After 
+ * 
+ *   plan__parent
+ *   %OPERATOR( $v1 : function_doc1( \@absolute_file_path ) ) )
+ *   plan__child
+ * </pre>
+ * 
+ * @author shivanim
+ */
+
+public class ConvertDocExpressionToFile implements IAlgebraicRewriteRule {
+
+    final ByteBufferInputStream bbis = new ByteBufferInputStream();
+    final DataInputStream di = new DataInputStream(bbis);
+    final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
+    final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
+    ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
+    final DataOutput dOut = abvs.getDataOutput();
+
+    @Override
+    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+            throws AlgebricksException {
+        boolean modified = false;
+        //returns the list of expressions inside the operator.
+        List<Mutable<ILogicalExpression>> expressions = OperatorToolbox.getExpressions(opRef);
+        //for each expression we go in
+        for (Mutable<ILogicalExpression> expression : expressions) {
+            //checks if the expression is a function call
+            //checks if the function call is fn_doc1
+            //returns the first expression contained in it only!
+            //what is a function has multiple arguments that is multiple expressions
+            Mutable<ILogicalExpression> docExpression = ExpressionToolbox.findFirstFunctionExpression(expression,
+                    BuiltinFunctions.FN_DOC_1.getFunctionIdentifier());
+            if (docExpression != null) {
+                AbstractFunctionCallExpression absFnCall = (AbstractFunctionCallExpression) docExpression.getValue();
+                if (docExpression != null && ifDocExpressionFound(opRef, absFnCall.getArguments().get(0), context)) {
+                    modified = true;
+                }
+            }
+        }
+        return modified;
+    }
+
+    //side note: I only see nested arguments, not multiple expressions in most cases.//
+    //Expressions == arguments ??
+
+    protected boolean ifDocExpressionFound(Mutable<ILogicalOperator> opRef, Mutable<ILogicalExpression> funcExpression,
+            IOptimizationContext context) {
+        VXQueryConstantValue constantValue = null;
+        ConstantExpression constantExpression = null;
+        ILogicalExpression logicalExpression = (ILogicalExpression) funcExpression.getValue();
+
+        if (logicalExpression.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
+
+            constantExpression = (ConstantExpression) logicalExpression;
+            constantValue = (VXQueryConstantValue) constantExpression.getValue();
+        } else if (logicalExpression.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+
+            VariableReferenceExpression varLogicalExpression = (VariableReferenceExpression) logicalExpression;
+            Mutable<ILogicalOperator> lop = OperatorToolbox.findProducerOf(opRef,
+                    varLogicalExpression.getVariableReference());
+            ILogicalExpression variableLogicalExpression = (ILogicalExpression) OperatorToolbox.getExpressionOf(lop,
+                    varLogicalExpression.getVariableReference()).getValue();
+            if (variableLogicalExpression.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
+                return false;
+            }
+            constantExpression = (ConstantExpression) variableLogicalExpression;
+            constantValue = (VXQueryConstantValue) constantExpression.getValue();
+        } else {
+            return false;
+        }
+
+        if (constantValue.getType() != SequenceType.create(BuiltinTypeRegistry.XS_STRING, Quantifier.QUANT_ONE)) {
+            return false;
+        }
+        tvp.set(constantValue.getValue(), 0, constantValue.getValue().length);
+        String collectionName = null;
+        tvp.getValue(stringp);
+        if (tvp.getTag() != ValueTag.XS_STRING_TAG) {
+            return false;
+        }
+        try {
+            bbis.setByteBuffer(
+                    ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(),
+                            stringp.getLength() + stringp.getStartOffset())), 0);
+            collectionName = di.readUTF();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        VXQueryMetadataProvider mdp = (VXQueryMetadataProvider) context.getMetadataProvider();
+        if (!mdp.sourceFileMap.containsKey(collectionName)) {
+            return false;
+        }
+        File file = mdp.sourceFileMap.get(collectionName);
+        StringValueBuilder svb = new StringValueBuilder();
+        try {
+            abvs.reset();
+            dOut.write(ValueTag.XS_STRING_TAG);
+            svb.write(file.getAbsolutePath(), dOut);
+
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        }
+        VXQueryConstantValue vxqcv = new VXQueryConstantValue(SequenceType.create(BuiltinTypeRegistry.XS_STRING,
+                Quantifier.QUANT_ONE), abvs.getByteArray());
+        constantExpression.setValue(vxqcv);
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
index 193b53d..3504d7d 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
@@ -78,9 +78,10 @@ public class EliminateUnnestAggregateSubplanRule implements IAlgebraicRewriteRul
             return false;
         }
         AbstractFunctionCallExpression functionCall = (AbstractFunctionCallExpression) logicalExpression;
+        /*
         if (!functionCall.getFunctionIdentifier().equals(BuiltinOperators.ITERATE.getFunctionIdentifier())) {
             return false;
-        }
+        }*/
 
         AbstractLogicalOperator op2 = (AbstractLogicalOperator) unnest.getInputs().get(0).getValue();
         if (op2.getOperatorTag() != LogicalOperatorTag.SUBPLAN) {

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/ExpressionToolbox.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/ExpressionToolbox.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/ExpressionToolbox.java
index e76fd15..2b2bf0c 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/ExpressionToolbox.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/ExpressionToolbox.java
@@ -39,7 +39,6 @@ import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReference
 import edu.uci.ics.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.AssignOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.NestedTupleSourceOperator;
 import edu.uci.ics.hyracks.algebricks.core.algebra.operators.logical.UnnestOperator;
 import edu.uci.ics.hyracks.data.std.primitive.IntegerPointable;
 

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
index 78cd80f..d0384a8 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
@@ -67,6 +67,9 @@ public class OperatorToolbox {
         switch (op.getOperatorTag()) {
             case AGGREGATE:
             case ASSIGN:
+                AbstractAssignOperator aap = (AbstractAssignOperator) op;
+                result.addAll(aap.getExpressions());
+                break;
             case RUNNINGAGGREGATE:
                 AbstractAssignOperator aao = (AbstractAssignOperator) op;
                 result.addAll(aao.getExpressions());

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
index 60bfb51..b0e4594 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
@@ -53,7 +53,7 @@ import edu.uci.ics.hyracks.dataflow.std.result.ResultWriterOperatorDescriptor;
 
 public class VXQueryMetadataProvider implements IMetadataProvider<String, String> {
     String[] nodeList;
-    Map<String, File> sourceFileMap;
+    public Map<String, File> sourceFileMap;
 
     public VXQueryMetadataProvider(String[] nodeList, Map<String, File> sourceFileMap) {
         this.nodeList = nodeList;

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/DocTest.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/DocTest.xml b/vxquery-xtest/src/test/resources/DocTest.xml
new file mode 100644
index 0000000..d38f112
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/DocTest.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE test-suite [
+
+<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
+
+<!ENTITY XMarkQueries SYSTEM "cat/XMarkOriginalQueries.xml">
+
+<!ENTITY TestRewriteRules SYSTEM "cat/TestRewriteRules.xml">
+
+]>
+<test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            CatalogDesignDate="2014-04-01"
+            version="0.0.1"
+            SourceOffsetPath="./"
+            ResultOffsetPath="ExpectedTestResults/"
+            XQueryQueryOffsetPath="Queries/XQuery/"
+            XQueryXQueryOffsetPath="Queries/XQueryX/"
+            XQueryFileExtension=".xq"
+            XQueryXFileExtension=".xqx"
+            xsi:schemaLocation="http://www.w3.org/2005/02/query-test-XQTSCatalog XQTSCatalog.xsd">
+
+  
+   <source ID="station_xml_file" FileName="TestSources/ghcnd/half_1/quarter_1/stations/US000000001.xml" Creator="Shivani Mall">
+       <description last-mod="2015-03-25">Collection of files</description>
+   </source>
+
+       <test-group name="XMarkQueriesExecutionTests" featureOwner="Shivani Mall">
+         &TestRewriteRules;
+      </test-group>
+</test-suite>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
new file mode 100644
index 0000000..e934f2c
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
@@ -0,0 +1,17 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<stationCollection pageSize="100" pageCount="1" totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
new file mode 100644
index 0000000..169a175
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
@@ -0,0 +1 @@
+<stationCollection pageSize="100"pageCount="1"totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
new file mode 100644
index 0000000..bce856c
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+   
+   doc("station_xml_file")/stationCollection
+   
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
index 773c276..5b9b234 100644
--- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
+++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
@@ -39,6 +39,10 @@
 <!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
 <!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml">
 
+<!ENTITY TestRewriteRules SYSTEM "cat/TestRewriteRules.xml">
+
+
+
 ]>
 <test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -82,10 +86,13 @@
      <source ID="ghcnd_quarter_4" FileName="TestSources/ghcnd/half_2/quarter_4" Creator="Preston Carman">
        <description last-mod="2014-04-02">Collection of files</description>
      </source>
+     <source ID="station_xml_file" FileName="TestSources/ghcnd/half_1/quarter_1/stations/US000000001.xml" Creator="Shivani Mall">
+       <description last-mod="2015-06-19">File</description>
+     </source>
    </sources>
-   <test-group name="SingleQuery" featureOwner="Preston Carman">
+   <test-group name="BasicQueries" featureOwner="Preston Carman">
       <GroupInfo>
-         <title>Single Query</title>
+         <title>Basic Queries</title>
          <description/>
       </GroupInfo>
       <test-group name="SingleTestAdd" featureOwner="Preston Carman">
@@ -98,10 +105,15 @@
       <test-group name="SingleTestList" featureOwner="Preston Carman">
          <GroupInfo>
             <title>Single Test List</title>
-            <description/>
-         </GroupInfo>
+          </GroupInfo>
          &SingleAlternateQuery;
       </test-group>
+      <test-group name="DocRewriteRuleTest" featureOwner="Shiavni Mall">
+         <GroupInfo>
+            <title>Doc Rewrite Rule Test</title>
+         </GroupInfo>
+         &TestRewriteRules;
+      </test-group>
    </test-group>
    <test-group name="AggregatePartitionQueries" featureOwner="Preston Carman">
       <GroupInfo>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml b/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
index 19011b7..add4fab 100644
--- a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
+++ b/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
@@ -5,9 +5,7 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-
       http://www.apache.org/licenses/LICENSE-2.0
-
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3e62dbe5/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml b/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
new file mode 100644
index 0000000..28677b3
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
@@ -0,0 +1,28 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="TestRewriteRuleQuery" featureOwner="VXQuery">
+   <GroupInfo>
+      <title>Test Rewrite Rule Query</title>
+   </GroupInfo>
+   <test-case name="TestConverDocExpRR" FilePath="Simple/" Creator="Shivani Mall">
+      <description>Test Rewrite Rule</description>
+      <query name="test" date="2015-06-19"/>
+      <output-file compare="Text">test.xml</output-file>
+   </test-case>
+</test-group>
+ 
\ No newline at end of file


[06/11] vxquery git commit: VXQueryCatalog added

Posted by pr...@apache.org.
VXQueryCatalog added


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/18ce2ad8
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/18ce2ad8
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/18ce2ad8

Branch: refs/heads/master
Commit: 18ce2ad86720eb859a88a0616f420361c1a55f95
Parents: 480a38f
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 16:56:56 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 16:56:56 2015 -0700

----------------------------------------------------------------------
 .../src/test/resources/VXQueryCatalog.xml       | 196 +++++++++++++++++++
 1 file changed, 196 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/18ce2ad8/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
index e69de29..6f7acee 100644
--- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
+++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!DOCTYPE test-suite [
+
+<!ENTITY AggregatePartition1Queries SYSTEM "cat/AggregatePartition1Queries.xml">
+<!ENTITY AggregatePartition2Queries SYSTEM "cat/AggregatePartition2Queries.xml">
+<!ENTITY AggregatePartition4Queries SYSTEM "cat/AggregatePartition4Queries.xml">
+
+<!ENTITY FunctionsAndOperatorsOnNumericsQueries SYSTEM "cat/FunctionsAndOperatorsOnNumericsQueries.xml">
+<!ENTITY FunctionsAndOperatorsThatGenerateSequences SYSTEM "cat/FunctionsAndOperatorsThatGenerateSequences.xml">
+
+<!ENTITY GhcndPartition1Queries SYSTEM "cat/GhcndPartition1Queries.xml">
+<!ENTITY GhcndPartition2Queries SYSTEM "cat/GhcndPartition2Queries.xml">
+<!ENTITY GhcndPartition4Queries SYSTEM "cat/GhcndPartition4Queries.xml">
+
+<!ENTITY GhcndRecordsPartition1Queries SYSTEM "cat/GhcndRecordsPartition1Queries.xml">
+<!ENTITY GhcndRecordsPartition2Queries SYSTEM "cat/GhcndRecordsPartition2Queries.xml">
+<!ENTITY GhcndRecordsPartition4Queries SYSTEM "cat/GhcndRecordsPartition4Queries.xml">
+
+<!ENTITY GhcndCountPartition1Queries SYSTEM "cat/GhcndCountPartition1Queries.xml">
+<!ENTITY GhcndCountPartition2Queries SYSTEM "cat/GhcndCountPartition2Queries.xml">
+<!ENTITY GhcndCountPartition4Queries SYSTEM "cat/GhcndCountPartition4Queries.xml">
+
+<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
+<!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml">
+
+]>
+<test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            CatalogDesignDate="2014-04-01"
+            version="0.0.1"
+            SourceOffsetPath="./"
+            ResultOffsetPath="ExpectedTestResults/"
+            XQueryQueryOffsetPath="Queries/XQuery/"
+            XQueryXQueryOffsetPath="Queries/XQueryX/"
+            XQueryFileExtension=".xq"
+            XQueryXFileExtension=".xqx"
+            xsi:schemaLocation="http://www.w3.org/2005/02/query-test-XQTSCatalog XQTSCatalog.xsd">
+   <test-suite-info>
+      <title>VXQuery Test Suite</title>
+      <description>
+         Test Suite for VXQuery.
+      </description>
+   </test-suite-info>
+   <sources>
+     <source ID="VXQueryCatalog" FileName="VXQueryCatalog.xml" Creator="VXQuery team">
+       <description last-mod="2014-04-02">VXQuery Test Suite Catalog</description>
+     </source>
+     <source ID="ghcnd" FileName="TestSources/ghcnd" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_half_1" FileName="TestSources/ghcnd/half_1" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_half_2" FileName="TestSources/ghcnd/half_2" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_quarter_1" FileName="TestSources/ghcnd/half_1/quarter_1" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_quarter_2" FileName="TestSources/ghcnd/half_1/quarter_2" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_quarter_3" FileName="TestSources/ghcnd/half_2/quarter_3" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="ghcnd_quarter_4" FileName="TestSources/ghcnd/half_2/quarter_4" Creator="Preston Carman">
+       <description last-mod="2014-04-02">Collection of files</description>
+     </source>
+     <source ID="station_xml_file" FileName="TestSources/ghcnd/half_1/quarter_1/stations/US000000001.xml" Creator="Shivani Mall">
+       <description last-mod="2015-06-26">File</description>
+     </source>
+   </sources>
+   <test-group name="SingleQuery" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>Single Query</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="SingleTestAdd" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Single Test Add</title>
+            <description/>
+         </GroupInfo>
+         &SingleQuery;
+      </test-group>
+      <test-group name="SingleTestList" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Single Test List</title>
+            <description/>
+         </GroupInfo>
+         &SingleAlternateQuery;
+      </test-group>
+   </test-group>
+   <test-group name="AggregatePartitionQueries" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>Aggregate Partition Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="AggregateParallelExecutionTests" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Aggregate Parallel Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &AggregatePartition1Queries;
+         &AggregatePartition2Queries;
+         &AggregatePartition4Queries;
+      </test-group>
+   </test-group>
+   <test-group name="FunctionsAndOperatorsOnNumericsQueries" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>Functions And Operators On Numerics Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="FunctionsAndOperatorsOnNumericsExecutionTests" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Functions And Operators On Numerics Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &FunctionsAndOperatorsOnNumericsQueries;
+      </test-group>
+   </test-group>
+   <test-group name="FunctionsAndOperatorsThatGenerateSequencesQueries" featureOwner="Shivani Mall">
+      <GroupInfo>
+         <title>Functions And Operators That Generate Sequences Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="FunctionsAndOperatorsThatGenerateSequencesTests" featureOwner="Shivani Mall">
+         <GroupInfo>
+            <title>Functions And Operators That Generate Sequences Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &FunctionsAndOperatorsThatGenerateSequences;
+      </test-group>
+   </test-group>
+   <test-group name="GhcndPartitionQueries" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>GHCND Partition Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="ParallelExecutionTests" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Parallel Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &GhcndPartition1Queries;
+         &GhcndPartition2Queries;
+         &GhcndPartition4Queries;
+      </test-group>
+   </test-group>
+   <test-group name="GhcndCountPartitionQueries" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>GHCND Count Partition Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="CountParallelExecutionTests" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Parallel Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &GhcndCountPartition1Queries;
+         &GhcndCountPartition2Queries;
+         &GhcndCountPartition4Queries;
+      </test-group>
+   </test-group>
+   <test-group name="GhcndRecordsPartitionQueries" featureOwner="Preston Carman">
+      <GroupInfo>
+         <title>GHCND Records Partition Queries</title>
+         <description/>
+      </GroupInfo>
+      <test-group name="RecordsParallelExecutionTests" featureOwner="Preston Carman">
+         <GroupInfo>
+            <title>Records Parallel Execution Tests</title>
+            <description/>
+         </GroupInfo>
+         &GhcndRecordsPartition1Queries;
+         &GhcndRecordsPartition2Queries;
+         &GhcndRecordsPartition4Queries;
+      </test-group>
+   </test-group>
+</test-suite>
\ No newline at end of file


[03/11] vxquery git commit: comments removed

Posted by pr...@apache.org.
comments removed


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/58ee9244
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/58ee9244
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/58ee9244

Branch: refs/heads/master
Commit: 58ee9244dd175c77c768b8ff72ddcb21c0a5a231
Parents: 911bc5b
Author: Shivani Mall <sm...@ucr.edu>
Authored: Mon Jun 22 15:32:12 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Mon Jun 22 15:32:12 2015 -0700

----------------------------------------------------------------------
 .../EliminateUnnestAggregateSubplanRule.java    |   4 +-
 vxquery-xtest/src/test/resources/DocTest.xml    |  47 -----
 .../src/test/resources/VXQueryCatalog.xml       | 189 -------------------
 3 files changed, 2 insertions(+), 238 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/58ee9244/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
index 3504d7d..c9e9586 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
@@ -78,10 +78,10 @@ public class EliminateUnnestAggregateSubplanRule implements IAlgebraicRewriteRul
             return false;
         }
         AbstractFunctionCallExpression functionCall = (AbstractFunctionCallExpression) logicalExpression;
-        /*
+
         if (!functionCall.getFunctionIdentifier().equals(BuiltinOperators.ITERATE.getFunctionIdentifier())) {
             return false;
-        }*/
+        }
 
         AbstractLogicalOperator op2 = (AbstractLogicalOperator) unnest.getInputs().get(0).getValue();
         if (op2.getOperatorTag() != LogicalOperatorTag.SUBPLAN) {

http://git-wip-us.apache.org/repos/asf/vxquery/blob/58ee9244/vxquery-xtest/src/test/resources/DocTest.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/DocTest.xml b/vxquery-xtest/src/test/resources/DocTest.xml
deleted file mode 100644
index d38f112..0000000
--- a/vxquery-xtest/src/test/resources/DocTest.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<!DOCTYPE test-suite [
-
-<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
-
-<!ENTITY XMarkQueries SYSTEM "cat/XMarkOriginalQueries.xml">
-
-<!ENTITY TestRewriteRules SYSTEM "cat/TestRewriteRules.xml">
-
-]>
-<test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            CatalogDesignDate="2014-04-01"
-            version="0.0.1"
-            SourceOffsetPath="./"
-            ResultOffsetPath="ExpectedTestResults/"
-            XQueryQueryOffsetPath="Queries/XQuery/"
-            XQueryXQueryOffsetPath="Queries/XQueryX/"
-            XQueryFileExtension=".xq"
-            XQueryXFileExtension=".xqx"
-            xsi:schemaLocation="http://www.w3.org/2005/02/query-test-XQTSCatalog XQTSCatalog.xsd">
-
-  
-   <source ID="station_xml_file" FileName="TestSources/ghcnd/half_1/quarter_1/stations/US000000001.xml" Creator="Shivani Mall">
-       <description last-mod="2015-03-25">Collection of files</description>
-   </source>
-
-       <test-group name="XMarkQueriesExecutionTests" featureOwner="Shivani Mall">
-         &TestRewriteRules;
-      </test-group>
-</test-suite>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/58ee9244/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
index aa4953d..e69de29 100644
--- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
+++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<!DOCTYPE test-suite [
-
-<!ENTITY AggregatePartition1Queries SYSTEM "cat/AggregatePartition1Queries.xml">
-<!ENTITY AggregatePartition2Queries SYSTEM "cat/AggregatePartition2Queries.xml">
-<!ENTITY AggregatePartition4Queries SYSTEM "cat/AggregatePartition4Queries.xml">
-
-<!ENTITY FunctionsAndOperatorsOnNumericsQueries SYSTEM "cat/FunctionsAndOperatorsOnNumericsQueries.xml">
-<!ENTITY FunctionsAndOperatorsThatGenerateSequences SYSTEM "cat/FunctionsAndOperatorsThatGenerateSequences.xml">
-
-<!ENTITY GhcndPartition1Queries SYSTEM "cat/GhcndPartition1Queries.xml">
-<!ENTITY GhcndPartition2Queries SYSTEM "cat/GhcndPartition2Queries.xml">
-<!ENTITY GhcndPartition4Queries SYSTEM "cat/GhcndPartition4Queries.xml">
-
-<!ENTITY GhcndRecordsPartition1Queries SYSTEM "cat/GhcndRecordsPartition1Queries.xml">
-<!ENTITY GhcndRecordsPartition2Queries SYSTEM "cat/GhcndRecordsPartition2Queries.xml">
-<!ENTITY GhcndRecordsPartition4Queries SYSTEM "cat/GhcndRecordsPartition4Queries.xml">
-
-<!ENTITY GhcndCountPartition1Queries SYSTEM "cat/GhcndCountPartition1Queries.xml">
-<!ENTITY GhcndCountPartition2Queries SYSTEM "cat/GhcndCountPartition2Queries.xml">
-<!ENTITY GhcndCountPartition4Queries SYSTEM "cat/GhcndCountPartition4Queries.xml">
-
-<!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
-<!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml">
-
-]>
-<test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            CatalogDesignDate="2014-04-01"
-            version="0.0.1"
-            SourceOffsetPath="./"
-            ResultOffsetPath="ExpectedTestResults/"
-            XQueryQueryOffsetPath="Queries/XQuery/"
-            XQueryXQueryOffsetPath="Queries/XQueryX/"
-            XQueryFileExtension=".xq"
-            XQueryXFileExtension=".xqx"
-            xsi:schemaLocation="http://www.w3.org/2005/02/query-test-XQTSCatalog XQTSCatalog.xsd">
-   <test-suite-info>
-      <title>VXQuery Test Suite</title>
-      <description>
-         Test Suite for VXQuery.
-      </description>
-   </test-suite-info>
-   <sources>
-     <source ID="VXQueryCatalog" FileName="VXQueryCatalog.xml" Creator="VXQuery team">
-       <description last-mod="2014-04-02">VXQuery Test Suite Catalog</description>
-     </source>
-     <source ID="ghcnd" FileName="TestSources/ghcnd" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_half_1" FileName="TestSources/ghcnd/half_1" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_half_2" FileName="TestSources/ghcnd/half_2" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_quarter_1" FileName="TestSources/ghcnd/half_1/quarter_1" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_quarter_2" FileName="TestSources/ghcnd/half_1/quarter_2" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_quarter_3" FileName="TestSources/ghcnd/half_2/quarter_3" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="ghcnd_quarter_4" FileName="TestSources/ghcnd/half_2/quarter_4" Creator="Preston Carman">
-       <description last-mod="2014-04-02">Collection of files</description>
-     </source>
-     <source ID="station_xml_file" FileName="TestSources/ghcnd/half_1/quarter_1/stations/US000000001.xml" Creator="Shivani Mall">
-       <description last-mod="2015-06-19">File</description>
-     </source>
-   </sources>
-   <test-group name="BasicQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>Basic Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="SingleTestAdd" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Single Test Add</title>
-            <description/>
-         </GroupInfo>
-         &SingleQuery;
-      </test-group>
-      <test-group name="SingleTestList" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Single Test List</title>
-          </GroupInfo>
-         &SingleAlternateQuery;
-      </test-group>
-   </test-group>
-   <test-group name="AggregatePartitionQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>Aggregate Partition Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="AggregateParallelExecutionTests" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Aggregate Parallel Execution Tests</title>
-            <description/>
-         </GroupInfo>
-         &AggregatePartition1Queries;
-         &AggregatePartition2Queries;
-         &AggregatePartition4Queries;
-      </test-group>
-   </test-group>
-   <test-group name="FunctionsAndOperatorsOnNumericsQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>Functions And Operators On Numerics Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="FunctionsAndOperatorsOnNumericsExecutionTests" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Functions And Operators On Numerics Execution Tests</title>
-            <description/>
-         </GroupInfo>
-         &FunctionsAndOperatorsOnNumericsQueries;
-      </test-group>
-   </test-group>
-   <test-group name="FunctionsAndOperatorsThatGenerateSequences" featureOwner="Shiavni Mall">
-        <GroupInfo>
-           <title>Functions and Operators that Generate Sequences</title>
-           <description/>
-        </GroupInfo>
-        &FunctionsAndOperatorsThatGenerateSequences;
-   </test-group>
-   <test-group name="GhcndPartitionQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>GHCND Partition Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="ParallelExecutionTests" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Parallel Execution Tests</title>
-            <description/>
-         </GroupInfo>
-         &GhcndPartition1Queries;
-         &GhcndPartition2Queries;
-         &GhcndPartition4Queries;
-      </test-group>
-   </test-group>
-   <test-group name="GhcndCountPartitionQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>GHCND Count Partition Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="CountParallelExecutionTests" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Parallel Execution Tests</title>
-            <description/>
-         </GroupInfo>
-         &GhcndCountPartition1Queries;
-         &GhcndCountPartition2Queries;
-         &GhcndCountPartition4Queries;
-      </test-group>
-   </test-group>
-   <test-group name="GhcndRecordsPartitionQueries" featureOwner="Preston Carman">
-      <GroupInfo>
-         <title>GHCND Records Partition Queries</title>
-         <description/>
-      </GroupInfo>
-      <test-group name="RecordsParallelExecutionTests" featureOwner="Preston Carman">
-         <GroupInfo>
-            <title>Records Parallel Execution Tests</title>
-            <description/>
-         </GroupInfo>
-         &GhcndRecordsPartition1Queries;
-         &GhcndRecordsPartition2Queries;
-         &GhcndRecordsPartition4Queries;
-      </test-group>
-   </test-group>
-</test-suite>


[07/11] vxquery git commit: ConvertDocExpressionToFile file removed

Posted by pr...@apache.org.
ConvertDocExpressionToFile file removed


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/33d62c3e
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/33d62c3e
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/33d62c3e

Branch: refs/heads/master
Commit: 33d62c3e2a0bc49e4c97bb0506831b0709634f77
Parents: 18ce2ad
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 18:19:02 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 18:19:02 2015 -0700

----------------------------------------------------------------------
 .../rules/ConvertDocExpressionToFile.java       | 171 -------------------
 1 file changed, 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/33d62c3e/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
deleted file mode 100644
index 7cf9616..0000000
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.vxquery.compiler.rewriter.rules;
-
-import java.io.DataInputStream;
-import java.io.DataOutput;
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.lang3.mutable.Mutable;
-import org.apache.vxquery.compiler.algebricks.VXQueryConstantValue;
-import org.apache.vxquery.compiler.rewriter.rules.util.ExpressionToolbox;
-import org.apache.vxquery.compiler.rewriter.rules.util.OperatorToolbox;
-import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
-import org.apache.vxquery.datamodel.builders.atomic.StringValueBuilder;
-import org.apache.vxquery.datamodel.values.ValueTag;
-import org.apache.vxquery.functions.BuiltinFunctions;
-import org.apache.vxquery.metadata.VXQueryMetadataProvider;
-import org.apache.vxquery.types.BuiltinTypeRegistry;
-import org.apache.vxquery.types.Quantifier;
-import org.apache.vxquery.types.SequenceType;
-
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
-import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
-import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
-import edu.uci.ics.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
-
-/**
- * The rule searches for where the function_doc1 function is in the plan in place of XQuery function.
- * It replaces the string contained in the function with its absolute file path.
- * 
- * <pre>
- * Before
- * 
- *   plan__parent
- *   %OPERATOR( $v1 : function_doc1( \@string ) )
- *   plan__child
- *   
- *   Where xquery_function creates an atomic value.
- *   
- * After 
- * 
- *   plan__parent
- *   %OPERATOR( $v1 : function_doc1( \@absolute_file_path ) ) )
- *   plan__child
- * </pre>
- * 
- * @author shivanim
- */
-
-public class ConvertDocExpressionToFile implements IAlgebraicRewriteRule {
-
-    final ByteBufferInputStream bbis = new ByteBufferInputStream();
-    final DataInputStream di = new DataInputStream(bbis);
-    final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
-    final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
-    ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
-    final DataOutput dOut = abvs.getDataOutput();
-
-    @Override
-    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
-            throws AlgebricksException {
-        boolean modified = false;
-        List<Mutable<ILogicalExpression>> expressions = OperatorToolbox.getExpressions(opRef);
-        for (Mutable<ILogicalExpression> expression : expressions) {
-            Mutable<ILogicalExpression> docExpression = ExpressionToolbox.findFirstFunctionExpression(expression,
-                    BuiltinFunctions.FN_DOC_1.getFunctionIdentifier());
-            if (docExpression != null) {
-                AbstractFunctionCallExpression absFnCall = (AbstractFunctionCallExpression) docExpression.getValue();
-                if (docExpression != null && ifDocExpressionFound(opRef, absFnCall.getArguments().get(0), context)) {
-                    modified = true;
-                }
-            }
-        }
-        return modified;
-    }
-
-    protected boolean ifDocExpressionFound(Mutable<ILogicalOperator> opRef, Mutable<ILogicalExpression> funcExpression,
-            IOptimizationContext context) {
-        VXQueryConstantValue constantValue = null;
-        ConstantExpression constantExpression = null;
-        ILogicalExpression logicalExpression = (ILogicalExpression) funcExpression.getValue();
-
-        if (logicalExpression.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
-
-            constantExpression = (ConstantExpression) logicalExpression;
-            constantValue = (VXQueryConstantValue) constantExpression.getValue();
-        } else if (logicalExpression.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
-
-            VariableReferenceExpression varLogicalExpression = (VariableReferenceExpression) logicalExpression;
-            Mutable<ILogicalOperator> lop = OperatorToolbox.findProducerOf(opRef,
-                    varLogicalExpression.getVariableReference());
-            ILogicalExpression variableLogicalExpression = (ILogicalExpression) OperatorToolbox.getExpressionOf(lop,
-                    varLogicalExpression.getVariableReference()).getValue();
-            if (variableLogicalExpression.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
-                return false;
-            }
-            constantExpression = (ConstantExpression) variableLogicalExpression;
-            constantValue = (VXQueryConstantValue) constantExpression.getValue();
-        } else {
-            return false;
-        }
-
-        if (constantValue.getType() != SequenceType.create(BuiltinTypeRegistry.XS_STRING, Quantifier.QUANT_ONE)) {
-            return false;
-        }
-        tvp.set(constantValue.getValue(), 0, constantValue.getValue().length);
-        String collectionName = null;
-        tvp.getValue(stringp);
-        if (tvp.getTag() != ValueTag.XS_STRING_TAG) {
-            return false;
-        }
-        try {
-            bbis.setByteBuffer(
-                    ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(),
-                            stringp.getLength() + stringp.getStartOffset())), 0);
-            collectionName = di.readUTF();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        VXQueryMetadataProvider mdp = (VXQueryMetadataProvider) context.getMetadataProvider();
-        if (!mdp.getSourceFileMap().containsKey(collectionName)) {
-            return false;
-        }
-        File file = mdp.getSourceFileMap().get(collectionName);
-        StringValueBuilder svb = new StringValueBuilder();
-        try {
-            abvs.reset();
-            dOut.write(ValueTag.XS_STRING_TAG);
-            svb.write(file.getAbsolutePath(), dOut);
-
-        } catch (IOException e) {
-            throw new IllegalStateException(e);
-        }
-        VXQueryConstantValue vxqcv = new VXQueryConstantValue(SequenceType.create(BuiltinTypeRegistry.XS_STRING,
-                Quantifier.QUANT_ONE), abvs.getByteArray());
-        constantExpression.setValue(vxqcv);
-        return true;
-    }
-}
\ No newline at end of file


[04/11] vxquery git commit: files renamed

Posted by pr...@apache.org.
files renamed


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/3129824a
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/3129824a
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/3129824a

Branch: refs/heads/master
Commit: 3129824ab96ab93c5edd41a0a5c324ba06136e0a
Parents: 58ee924
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 15:19:47 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 15:19:47 2015 -0700

----------------------------------------------------------------------
 .../compiler/rewriter/RewriteRuleset.java       |   4 +-
 .../rules/ReplaceSourceMapInDocExpression.java  | 171 +++++++++++++++++++
 2 files changed, 173 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/3129824a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
index 3648f2f..8e2a367 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
@@ -21,7 +21,7 @@ import java.util.List;
 
 import org.apache.vxquery.compiler.rewriter.rules.ConsolidateAssignAggregateRule;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertAssignToUnnestRule;
-import org.apache.vxquery.compiler.rewriter.rules.ConvertDocExpressionToFile;
+import org.apache.vxquery.compiler.rewriter.rules.ReplaceSourceMapInDocExpression;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertFromAlgebricksExpressionsRule;
 import org.apache.vxquery.compiler.rewriter.rules.ConvertToAlgebricksExpressionsRule;
 import org.apache.vxquery.compiler.rewriter.rules.EliminateSubplanForSingleItemsRule;
@@ -117,7 +117,7 @@ public class RewriteRuleset {
         normalization.add(new IntroduceCollectionRule());
         normalization.add(new RemoveUnusedAssignAndAggregateRule());
 
-        normalization.add(new ConvertDocExpressionToFile());
+        normalization.add(new ReplaceSourceMapInDocExpression());
         // Adds child steps to the data source scan.
         // TODO Replace consolidate with a new child function that takes multiple paths.
         //        normalization.add(new ConsolidateUnnestsRule());

http://git-wip-us.apache.org/repos/asf/vxquery/blob/3129824a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
new file mode 100644
index 0000000..b656185
--- /dev/null
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
@@ -0,0 +1,171 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.vxquery.compiler.rewriter.rules;
+
+import java.io.DataInputStream;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.vxquery.compiler.algebricks.VXQueryConstantValue;
+import org.apache.vxquery.compiler.rewriter.rules.util.ExpressionToolbox;
+import org.apache.vxquery.compiler.rewriter.rules.util.OperatorToolbox;
+import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
+import org.apache.vxquery.datamodel.builders.atomic.StringValueBuilder;
+import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.functions.BuiltinFunctions;
+import org.apache.vxquery.metadata.VXQueryMetadataProvider;
+import org.apache.vxquery.types.BuiltinTypeRegistry;
+import org.apache.vxquery.types.Quantifier;
+import org.apache.vxquery.types.SequenceType;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalOperator;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.IOptimizationContext;
+import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalExpressionTag;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.ConstantExpression;
+import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression;
+import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
+import edu.uci.ics.hyracks.data.std.primitive.UTF8StringPointable;
+import edu.uci.ics.hyracks.data.std.util.ArrayBackedValueStorage;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+
+/**
+ * The rule searches for where the function_doc1 function is in the plan in place of XQuery function.
+ * It replaces the string contained in the function with its absolute file path.
+ * 
+ * <pre>
+ * Before
+ * 
+ *   plan__parent
+ *   %OPERATOR( $v1 : fn:doc( \@string ) )
+ *   plan__child
+ *   
+ *   Where xquery_function creates an atomic value.
+ *   
+ * After 
+ * 
+ *   plan__parent
+ *   %OPERATOR( $v1 : fn:doc( \@absolute_file_path ) ) )
+ *   plan__child
+ * </pre>
+ * 
+ * @author shivanim
+ */
+
+public class ReplaceSourceMapInDocExpression implements IAlgebraicRewriteRule {
+
+    final ByteBufferInputStream bbis = new ByteBufferInputStream();
+    final DataInputStream di = new DataInputStream(bbis);
+    final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable();
+    final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
+    final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
+    final DataOutput dOut = abvs.getDataOutput();
+
+    @Override
+    public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
+            throws AlgebricksException {
+        boolean modified = false;
+        List<Mutable<ILogicalExpression>> expressions = OperatorToolbox.getExpressions(opRef);
+        for (Mutable<ILogicalExpression> expression : expressions) {
+            Mutable<ILogicalExpression> docExpression = ExpressionToolbox.findFirstFunctionExpression(expression,
+                    BuiltinFunctions.FN_DOC_1.getFunctionIdentifier());
+            if (docExpression != null) {
+                AbstractFunctionCallExpression absFnCall = (AbstractFunctionCallExpression) docExpression.getValue();
+                if (updateDocExpression(opRef, absFnCall.getArguments().get(0), context)) {
+                    modified = true;
+                }
+            }
+        }
+        return modified;
+    }
+
+    protected boolean updateDocExpression(Mutable<ILogicalOperator> opRef, Mutable<ILogicalExpression> funcExpression,
+            IOptimizationContext context) {
+        VXQueryConstantValue constantValue = null;
+        ConstantExpression constantExpression = null;
+        ILogicalExpression logicalExpression = (ILogicalExpression) funcExpression.getValue();
+
+        if (logicalExpression.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
+
+            constantExpression = (ConstantExpression) logicalExpression;
+            constantValue = (VXQueryConstantValue) constantExpression.getValue();
+        } else if (logicalExpression.getExpressionTag() == LogicalExpressionTag.VARIABLE) {
+
+            VariableReferenceExpression varLogicalExpression = (VariableReferenceExpression) logicalExpression;
+            Mutable<ILogicalOperator> lop = OperatorToolbox.findProducerOf(opRef,
+                    varLogicalExpression.getVariableReference());
+            ILogicalExpression variableLogicalExpression = (ILogicalExpression) OperatorToolbox.getExpressionOf(lop,
+                    varLogicalExpression.getVariableReference()).getValue();
+            if (variableLogicalExpression.getExpressionTag() != LogicalExpressionTag.CONSTANT) {
+                return false;
+            }
+            constantExpression = (ConstantExpression) variableLogicalExpression;
+            constantValue = (VXQueryConstantValue) constantExpression.getValue();
+        } else {
+            return false;
+        }
+
+        if (constantValue.getType() != SequenceType.create(BuiltinTypeRegistry.XS_STRING, Quantifier.QUANT_ONE)) {
+            return false;
+        }
+        tvp.set(constantValue.getValue(), 0, constantValue.getValue().length);
+        String collectionName = null;
+        tvp.getValue(stringp);
+        if (tvp.getTag() != ValueTag.XS_STRING_TAG) {
+            return false;
+        }
+        try {
+            bbis.setByteBuffer(
+                    ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(),
+                            stringp.getLength() + stringp.getStartOffset())), 0);
+            collectionName = di.readUTF();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        VXQueryMetadataProvider mdp = (VXQueryMetadataProvider) context.getMetadataProvider();
+        if (!mdp.getSourceFileMap().containsKey(collectionName)) {
+            return false;
+        }
+        File file = mdp.getSourceFileMap().get(collectionName);
+        StringValueBuilder svb = new StringValueBuilder();
+        try {
+            abvs.reset();
+            dOut.write(ValueTag.XS_STRING_TAG);
+            svb.write(file.getAbsolutePath(), dOut);
+
+        } catch (IOException e) {
+            throw new IllegalStateException(e);
+        }
+        VXQueryConstantValue vxqcv = new VXQueryConstantValue(SequenceType.create(BuiltinTypeRegistry.XS_STRING,
+                Quantifier.QUANT_ONE), abvs.getByteArray());
+        constantExpression.setValue(vxqcv);
+        return true;
+    }
+}
\ No newline at end of file


[05/11] vxquery git commit: changes made to include github comments

Posted by pr...@apache.org.
changes made to include github comments


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/480a38fb
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/480a38fb
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/480a38fb

Branch: refs/heads/master
Commit: 480a38fb0545e6fa0f588ea1a3e51848bb3a3556
Parents: 3129824
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 16:36:15 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 16:36:15 2015 -0700

----------------------------------------------------------------------
 .../EliminateUnnestAggregateSubplanRule.java    |  1 -
 .../rules/ReplaceSourceMapInDocExpression.java  | 20 +++++++-------------
 .../rewriter/rules/util/OperatorToolbox.java    |  3 ---
 .../ExpectedTestResults/Simple/fn_doc.xml       | 18 +++++++++++++++++-
 4 files changed, 24 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/480a38fb/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
index c9e9586..193b53d 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/EliminateUnnestAggregateSubplanRule.java
@@ -78,7 +78,6 @@ public class EliminateUnnestAggregateSubplanRule implements IAlgebraicRewriteRul
             return false;
         }
         AbstractFunctionCallExpression functionCall = (AbstractFunctionCallExpression) logicalExpression;
-
         if (!functionCall.getFunctionIdentifier().equals(BuiltinOperators.ITERATE.getFunctionIdentifier())) {
             return false;
         }

http://git-wip-us.apache.org/repos/asf/vxquery/blob/480a38fb/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
index b656185..29e0def 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ReplaceSourceMapInDocExpression.java
@@ -20,8 +20,6 @@ import java.io.DataInputStream;
 import java.io.DataOutput;
 import java.io.File;
 import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
 import java.util.List;
 
 import org.apache.commons.lang3.mutable.Mutable;
@@ -81,6 +79,8 @@ public class ReplaceSourceMapInDocExpression implements IAlgebraicRewriteRule {
     final TaggedValuePointable tvp = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
     final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
     final DataOutput dOut = abvs.getDataOutput();
+    StringBuilder toStr = new StringBuilder();
+    String docArg = null;
 
     @Override
     public boolean rewritePre(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
@@ -136,24 +136,18 @@ public class ReplaceSourceMapInDocExpression implements IAlgebraicRewriteRule {
             return false;
         }
         tvp.set(constantValue.getValue(), 0, constantValue.getValue().length);
-        String collectionName = null;
         tvp.getValue(stringp);
         if (tvp.getTag() != ValueTag.XS_STRING_TAG) {
             return false;
         }
-        try {
-            bbis.setByteBuffer(
-                    ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(),
-                            stringp.getLength() + stringp.getStartOffset())), 0);
-            collectionName = di.readUTF();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
+        stringp.toString(toStr);
+        docArg = toStr.toString();
+
         VXQueryMetadataProvider mdp = (VXQueryMetadataProvider) context.getMetadataProvider();
-        if (!mdp.getSourceFileMap().containsKey(collectionName)) {
+        if (!mdp.getSourceFileMap().containsKey(docArg)) {
             return false;
         }
-        File file = mdp.getSourceFileMap().get(collectionName);
+        File file = mdp.getSourceFileMap().get(docArg);
         StringValueBuilder svb = new StringValueBuilder();
         try {
             abvs.reset();

http://git-wip-us.apache.org/repos/asf/vxquery/blob/480a38fb/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
index d0384a8..78cd80f 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/util/OperatorToolbox.java
@@ -67,9 +67,6 @@ public class OperatorToolbox {
         switch (op.getOperatorTag()) {
             case AGGREGATE:
             case ASSIGN:
-                AbstractAssignOperator aap = (AbstractAssignOperator) op;
-                result.addAll(aap.getExpressions());
-                break;
             case RUNNINGAGGREGATE:
                 AbstractAssignOperator aao = (AbstractAssignOperator) op;
                 result.addAll(aao.getExpressions());

http://git-wip-us.apache.org/repos/asf/vxquery/blob/480a38fb/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
index 169a175..e934f2c 100644
--- a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
@@ -1 +1,17 @@
-<stationCollection pageSize="100"pageCount="1"totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<stationCollection pageSize="100" pageCount="1" totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file


[11/11] vxquery git commit: Merge branch 'shivanim/docrewriterule-files-to-add'

Posted by pr...@apache.org.
Merge branch 'shivanim/docrewriterule-files-to-add'


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/c849b88a
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/c849b88a
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/c849b88a

Branch: refs/heads/master
Commit: c849b88a707e12ed4308f83ec1145fe9e1f1fbc9
Parents: aeaa2f1 e735833
Author: Preston Carman <pr...@apache.org>
Authored: Sun Jun 28 11:30:01 2015 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Sun Jun 28 11:30:01 2015 -0700

----------------------------------------------------------------------
 .../compiler/rewriter/RewriteRuleset.java       |   2 +
 .../rules/ReplaceSourceMapInDocExpression.java  | 165 +++++++++++++++++++
 .../rewriter/rules/util/ExpressionToolbox.java  |   1 -
 .../metadata/VXQueryMetadataProvider.java       |   4 +
 .../ExpectedTestResults/Simple/fn_doc.xml       |   1 +
 .../resources/Queries/XQuery/Simple/fn_doc.xq   |  19 +++
 .../src/test/resources/VXQueryCatalog.xml       |  19 ++-
 .../FunctionsAndOperatorsOnNumericsQueries.xml  |   2 +-
 ...nctionsAndOperatorsThatGenerateSequences.xml |  28 ++++
 .../resources/cat/GhcndPartition2Queries.xml    |   2 +-
 .../test/resources/cat/SingleAlternateQuery.xml |   2 +-
 .../src/test/resources/cat/SingleQuery.xml      |  28 ----
 .../test/resources/cat/XMarkOriginalQueries.xml |   2 +-
 13 files changed, 241 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/c849b88a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/RewriteRuleset.java
----------------------------------------------------------------------


[10/11] vxquery git commit: SingleQuery file removed

Posted by pr...@apache.org.
SingleQuery file removed


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/e7358333
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/e7358333
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/e7358333

Branch: refs/heads/master
Commit: e73583338c0fa53153009eb2358192d101a6279f
Parents: 66f663a
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 19:29:07 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 19:29:07 2015 -0700

----------------------------------------------------------------------
 .../src/test/resources/cat/SingleQuery.xml      | 26 --------------------
 1 file changed, 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/e7358333/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml b/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
deleted file mode 100644
index 42ab548..0000000
--- a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-      http://www.apache.org/licenses/LICENSE-2.0
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="SingleQuery" featureOwner="VXQuery">
-   <GroupInfo>
-      <title>Single Test</title>
-      <description/>
-   </GroupInfo>
-   <test-case name="simple-add" FilePath="Simple/" Creator="Preston Carman">
-      <description>Adds two numbers.</description>
-      <query name="add" date="2014-08-18"/>
-      <output-file compare="Text">add.txt</output-file>
-   </test-case>
-</test-group>
\ No newline at end of file


[09/11] vxquery git commit: expected result for query updated

Posted by pr...@apache.org.
expected result for query updated


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/66f663a6
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/66f663a6
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/66f663a6

Branch: refs/heads/master
Commit: 66f663a6d649f686b7b0cef3e9a50904af170e4d
Parents: 0f0fe60
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 19:02:11 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 19:02:11 2015 -0700

----------------------------------------------------------------------
 .../resources/ExpectedTestResults/Simple/fn_doc.xml | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/66f663a6/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
index e934f2c..3b9d17a 100644
--- a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
@@ -1,17 +1 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
 <stationCollection pageSize="100" pageCount="1" totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file


[02/11] vxquery git commit: rewrite rule and test implemented to fix fn:doc

Posted by pr...@apache.org.
rewrite rule and test implemented to fix fn:doc


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/911bc5b1
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/911bc5b1
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/911bc5b1

Branch: refs/heads/master
Commit: 911bc5b113f372292e66becd513b5fcadabd8291
Parents: 3e62dbe
Author: Shivani Mall <sm...@ucr.edu>
Authored: Mon Jun 22 15:17:21 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Mon Jun 22 15:17:21 2015 -0700

----------------------------------------------------------------------
 .../rules/ConvertDocExpressionToFile.java       | 13 ++-------
 .../metadata/VXQueryMetadataProvider.java       |  6 ++++-
 .../ExpectedTestResults/Simple/fn_doc.xml       |  1 +
 .../resources/Queries/XQuery/Simple/fn_doc.xq   | 19 +++++++++++++
 .../src/test/resources/VXQueryCatalog.xml       | 18 ++++++-------
 .../FunctionsAndOperatorsOnNumericsQueries.xml  |  2 +-
 ...nctionsAndOperatorsThatGenerateSequences.xml | 28 ++++++++++++++++++++
 .../resources/cat/GhcndPartition2Queries.xml    |  2 +-
 .../test/resources/cat/SingleAlternateQuery.xml |  2 +-
 .../src/test/resources/cat/SingleQuery.xml      |  2 +-
 .../test/resources/cat/XMarkOriginalQueries.xml |  2 +-
 11 files changed, 68 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
index c64157f..7cf9616 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/ConvertDocExpressionToFile.java
@@ -92,14 +92,8 @@ public class ConvertDocExpressionToFile implements IAlgebraicRewriteRule {
     public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context)
             throws AlgebricksException {
         boolean modified = false;
-        //returns the list of expressions inside the operator.
         List<Mutable<ILogicalExpression>> expressions = OperatorToolbox.getExpressions(opRef);
-        //for each expression we go in
         for (Mutable<ILogicalExpression> expression : expressions) {
-            //checks if the expression is a function call
-            //checks if the function call is fn_doc1
-            //returns the first expression contained in it only!
-            //what is a function has multiple arguments that is multiple expressions
             Mutable<ILogicalExpression> docExpression = ExpressionToolbox.findFirstFunctionExpression(expression,
                     BuiltinFunctions.FN_DOC_1.getFunctionIdentifier());
             if (docExpression != null) {
@@ -112,9 +106,6 @@ public class ConvertDocExpressionToFile implements IAlgebraicRewriteRule {
         return modified;
     }
 
-    //side note: I only see nested arguments, not multiple expressions in most cases.//
-    //Expressions == arguments ??
-
     protected boolean ifDocExpressionFound(Mutable<ILogicalOperator> opRef, Mutable<ILogicalExpression> funcExpression,
             IOptimizationContext context) {
         VXQueryConstantValue constantValue = null;
@@ -159,10 +150,10 @@ public class ConvertDocExpressionToFile implements IAlgebraicRewriteRule {
             e.printStackTrace();
         }
         VXQueryMetadataProvider mdp = (VXQueryMetadataProvider) context.getMetadataProvider();
-        if (!mdp.sourceFileMap.containsKey(collectionName)) {
+        if (!mdp.getSourceFileMap().containsKey(collectionName)) {
             return false;
         }
-        File file = mdp.sourceFileMap.get(collectionName);
+        File file = mdp.getSourceFileMap().get(collectionName);
         StringValueBuilder svb = new StringValueBuilder();
         try {
             abvs.reset();

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
index b0e4594..b2ab17c 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/metadata/VXQueryMetadataProvider.java
@@ -53,7 +53,7 @@ import edu.uci.ics.hyracks.dataflow.std.result.ResultWriterOperatorDescriptor;
 
 public class VXQueryMetadataProvider implements IMetadataProvider<String, String> {
     String[] nodeList;
-    public Map<String, File> sourceFileMap;
+    Map<String, File> sourceFileMap;
 
     public VXQueryMetadataProvider(String[] nodeList, Map<String, File> sourceFileMap) {
         this.nodeList = nodeList;
@@ -65,6 +65,10 @@ public class VXQueryMetadataProvider implements IMetadataProvider<String, String
         return null;
     }
 
+    public Map<String, File> getSourceFileMap() {
+        return sourceFileMap;
+    }
+
     @Override
     public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getScannerRuntime(IDataSource<String> dataSource,
             List<LogicalVariable> scanVariables, List<LogicalVariable> projectVariables, boolean projectPushed,

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
new file mode 100644
index 0000000..169a175
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/fn_doc.xml
@@ -0,0 +1 @@
+<stationCollection pageSize="100"pageCount="1"totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/fn_doc.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/fn_doc.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/fn_doc.xq
new file mode 100644
index 0000000..bce856c
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/fn_doc.xq
@@ -0,0 +1,19 @@
+(: Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+   
+     http://www.apache.org/licenses/LICENSE-2.0
+   
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License. :)
+   
+   doc("station_xml_file")/stationCollection
+   
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
index 5b9b234..aa4953d 100644
--- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
+++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml
@@ -23,6 +23,7 @@
 <!ENTITY AggregatePartition4Queries SYSTEM "cat/AggregatePartition4Queries.xml">
 
 <!ENTITY FunctionsAndOperatorsOnNumericsQueries SYSTEM "cat/FunctionsAndOperatorsOnNumericsQueries.xml">
+<!ENTITY FunctionsAndOperatorsThatGenerateSequences SYSTEM "cat/FunctionsAndOperatorsThatGenerateSequences.xml">
 
 <!ENTITY GhcndPartition1Queries SYSTEM "cat/GhcndPartition1Queries.xml">
 <!ENTITY GhcndPartition2Queries SYSTEM "cat/GhcndPartition2Queries.xml">
@@ -39,10 +40,6 @@
 <!ENTITY SingleQuery SYSTEM "cat/SingleQuery.xml">
 <!ENTITY SingleAlternateQuery SYSTEM "cat/SingleAlternateQuery.xml">
 
-<!ENTITY TestRewriteRules SYSTEM "cat/TestRewriteRules.xml">
-
-
-
 ]>
 <test-suite xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -108,12 +105,6 @@
           </GroupInfo>
          &SingleAlternateQuery;
       </test-group>
-      <test-group name="DocRewriteRuleTest" featureOwner="Shiavni Mall">
-         <GroupInfo>
-            <title>Doc Rewrite Rule Test</title>
-         </GroupInfo>
-         &TestRewriteRules;
-      </test-group>
    </test-group>
    <test-group name="AggregatePartitionQueries" featureOwner="Preston Carman">
       <GroupInfo>
@@ -143,6 +134,13 @@
          &FunctionsAndOperatorsOnNumericsQueries;
       </test-group>
    </test-group>
+   <test-group name="FunctionsAndOperatorsThatGenerateSequences" featureOwner="Shiavni Mall">
+        <GroupInfo>
+           <title>Functions and Operators that Generate Sequences</title>
+           <description/>
+        </GroupInfo>
+        &FunctionsAndOperatorsThatGenerateSequences;
+   </test-group>
    <test-group name="GhcndPartitionQueries" featureOwner="Preston Carman">
       <GroupInfo>
          <title>GHCND Partition Queries</title>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml b/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml
index aacc9ea..52a1e69 100644
--- a/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml
+++ b/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml
@@ -15,7 +15,7 @@
   limitations under the License.
 -->
 
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="GhcndRecordsPartition1Queries" featureOwner="VXQuery">
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="FunctionsAndOperatorsOnNumericQueries" featureOwner="VXQuery">
    <GroupInfo>
       <title>Function and Operators on Numerics</title>
       <description/>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsThatGenerateSequences.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsThatGenerateSequences.xml b/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsThatGenerateSequences.xml
new file mode 100644
index 0000000..2b52f15
--- /dev/null
+++ b/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsThatGenerateSequences.xml
@@ -0,0 +1,28 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="FunctionsAndOperatorsThatGenerateSequences" featureOwner="VXQuery">
+   <GroupInfo>
+      <title>Functions and Operators that Generate Sequences</title>
+   </GroupInfo>
+   <test-case name="functions-and-operators-that-generate-sequences-fn_doc" FilePath="Simple/" Creator="Shivani Mall">
+      <description>Query for fn:doc with uri.</description>
+      <query name="fn_doc" date="2015-06-19"/>
+      <output-file compare="Text">fn_doc.xml</output-file>
+   </test-case>
+</test-group>
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/GhcndPartition2Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndPartition2Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndPartition2Queries.xml
index 73c01e1..1075183 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndPartition2Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndPartition2Queries.xml
@@ -15,7 +15,7 @@
   limitations under the License.
 -->
 
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="GhcndPartition1Queries" featureOwner="VXQuery">
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="GhcndPartition2Queries" featureOwner="VXQuery">
    <GroupInfo>
       <title>GHCND Partition 1</title>
       <description/>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml b/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml
index ea444d8..bba230c 100644
--- a/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml
+++ b/vxquery-xtest/src/test/resources/cat/SingleAlternateQuery.xml
@@ -15,7 +15,7 @@
   limitations under the License.
 -->
 
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="AggregatePartition1Queries" featureOwner="VXQuery">
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="SingleAlternateQuery" featureOwner="VXQuery">
    <GroupInfo>
       <title>Single Test</title>
       <description/>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml b/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
index add4fab..42ab548 100644
--- a/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
+++ b/vxquery-xtest/src/test/resources/cat/SingleQuery.xml
@@ -13,7 +13,7 @@
   limitations under the License.
 -->
 
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="AggregatePartition1Queries" featureOwner="VXQuery">
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="SingleQuery" featureOwner="VXQuery">
    <GroupInfo>
       <title>Single Test</title>
       <description/>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/911bc5b1/vxquery-xtest/src/test/resources/cat/XMarkOriginalQueries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/XMarkOriginalQueries.xml b/vxquery-xtest/src/test/resources/cat/XMarkOriginalQueries.xml
index 3ebe301..87a57d1 100644
--- a/vxquery-xtest/src/test/resources/cat/XMarkOriginalQueries.xml
+++ b/vxquery-xtest/src/test/resources/cat/XMarkOriginalQueries.xml
@@ -15,7 +15,7 @@
   limitations under the License.
 -->
 
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="XMarkQueries" featureOwner="VXQuery">
+<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="XMarkOriginalQueries" featureOwner="VXQuery">
    <GroupInfo>
       <title>XMark Queries</title>
       <description/>


[08/11] vxquery git commit: files removed from git

Posted by pr...@apache.org.
files removed from git


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/0f0fe60f
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/0f0fe60f
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/0f0fe60f

Branch: refs/heads/master
Commit: 0f0fe60f1a06001c31f5866bc49ff4218b3e75b9
Parents: 33d62c3
Author: Shivani Mall <sm...@ucr.edu>
Authored: Fri Jun 26 18:27:32 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Fri Jun 26 18:27:32 2015 -0700

----------------------------------------------------------------------
 .../ExpectedTestResults/Simple/US000000001.xml  | 17 ------------
 .../ExpectedTestResults/Simple/test.xml         |  1 -
 .../resources/Queries/XQuery/Simple/test.xq     | 19 -------------
 .../src/test/resources/cat/TestRewriteRules.xml | 28 --------------------
 4 files changed, 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/0f0fe60f/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
deleted file mode 100644
index e934f2c..0000000
--- a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/US000000001.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<stationCollection pageSize="100" pageCount="1" totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/0f0fe60f/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml b/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
deleted file mode 100644
index 169a175..0000000
--- a/vxquery-xtest/src/test/resources/ExpectedTestResults/Simple/test.xml
+++ /dev/null
@@ -1 +0,0 @@
-<stationCollection pageSize="100"pageCount="1"totalCount="1"><station><id>GHCND:US000000001</id><displayName>Station 1</displayName><latitude>10.000</latitude><longitude>-10.000</longitude><elevation>1000.0</elevation><locationLabels><type>ST</type><id>FIPS:1</id><displayName>State 1</displayName></locationLabels><locationLabels><type>CNTY</type><id>FIPS:-9999</id><displayName>County 1</displayName></locationLabels><locationLabels><type>CNTRY</type><id>FIPS:US</id><displayName>UNITED STATES</displayName></locationLabels></station></stationCollection>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/0f0fe60f/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
deleted file mode 100644
index bce856c..0000000
--- a/vxquery-xtest/src/test/resources/Queries/XQuery/Simple/test.xq
+++ /dev/null
@@ -1,19 +0,0 @@
-(: Licensed to the Apache Software Foundation (ASF) under one
-   or more contributor license agreements.  See the NOTICE file
-   distributed with this work for additional information
-   regarding copyright ownership.  The ASF licenses this file
-   to you under the Apache License, Version 2.0 (the
-   "License"); you may not use this file except in compliance
-   with the License.  You may obtain a copy of the License at
-   
-     http://www.apache.org/licenses/LICENSE-2.0
-   
-   Unless required by applicable law or agreed to in writing,
-   software distributed under the License is distributed on an
-   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-   KIND, either express or implied.  See the License for the
-   specific language governing permissions and limitations
-   under the License. :)
-   
-   doc("station_xml_file")/stationCollection
-   
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/0f0fe60f/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml b/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
deleted file mode 100644
index 28677b3..0000000
--- a/vxquery-xtest/src/test/resources/cat/TestRewriteRules.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<test-group xmlns="http://www.w3.org/2005/02/query-test-XQTSCatalog" name="TestRewriteRuleQuery" featureOwner="VXQuery">
-   <GroupInfo>
-      <title>Test Rewrite Rule Query</title>
-   </GroupInfo>
-   <test-case name="TestConverDocExpRR" FilePath="Simple/" Creator="Shivani Mall">
-      <description>Test Rewrite Rule</description>
-      <query name="test" date="2015-06-19"/>
-      <output-file compare="Text">test.xml</output-file>
-   </test-case>
-</test-group>
- 
\ No newline at end of file