Added two new test cases for numeric functions. Also includes a few bug fixes and clean up items.
Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/0ff85572 Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/0ff85572 Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/0ff85572 Branch: refs/heads/prestonc/november_update Commit: 0ff85572e0140b12b478ea58789910d8f059d0b3 Parents: d5101a1 Author: Preston Carman <[email protected]> Authored: Thu Feb 5 11:47:12 2015 -0800 Committer: Preston Carman <[email protected]> Committed: Thu Feb 5 11:47:12 2015 -0800 ---------------------------------------------------------------------- .../noaa-ghcn-daily/scripts/run_benchmark.sh | 2 +- vxquery-cli/pom.xml | 287 ++++++++++--------- .../java/org/apache/vxquery/cli/VXQuery.java | 3 +- .../accessors/atomic/XSDecimalPointable.java | 2 +- .../AvgGlobalAggregateEvaluatorFactory.java | 2 - .../FnAvgAggregateEvaluatorFactory.java | 2 - .../functions/numeric/FnCeilingOperation.java | 4 +- .../functions/numeric/FnRoundOperation.java | 4 +- .../src/main/resources/conf/cluster.properties | 6 +- .../ExpectedTestResults/Numerics/fn:abs.txt | 8 + .../ExpectedTestResults/Numerics/fn:ceiling.txt | 8 + .../resources/Queries/XQuery/Numerics/fn:abs.xq | 22 ++ .../Queries/XQuery/Numerics/fn:ceiling.xq | 22 ++ .../src/test/resources/VXQueryCatalog.xml | 15 + .../FunctionsAndOperatorsOnNumericsQueries.xml | 33 +++ 15 files changed, 263 insertions(+), 157 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh index c4d8922..5be4696 100755 --- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh @@ -37,7 +37,7 @@ then exit fi -export JAVA_OPTS="$JAVA_OPTS -server -Xmx7G -Djava.util.logging.config.file=./vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/testing_logging.properties" +export JAVA_OPTS="$JAVA_OPTS -server -Xmx500M -Djava.util.logging.config.file=./vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/testing_logging.properties" for j in $(find ${1} -name '*q??.xq') do http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-cli/pom.xml ---------------------------------------------------------------------- diff --git a/vxquery-cli/pom.xml b/vxquery-cli/pom.xml index ab94c18..b5144d1 100644 --- a/vxquery-cli/pom.xml +++ b/vxquery-cli/pom.xml @@ -14,152 +14,155 @@ See the License for the specific language governing permissions and limitations under the License. --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.vxquery</groupId> - <artifactId>apache-vxquery</artifactId> - <version>0.5-SNAPSHOT</version> - </parent> - - <artifactId>apache-vxquery-cli</artifactId> - <packaging>jar</packaging> - <name>VXQuery CLI</name> - <description>Apache VXQuery Command-Line Utility</description> - - <distributionManagement> - <site> - <id>vxquery.website</id> - <name>VXQuery Website</name> - <url>file:../site/vxquery-cli/</url> - </site> - </distributionManagement> - - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>appassembler-maven-plugin</artifactId> - <version>1.3</version> - <executions> - <execution> - <configuration> - <programs> - <program> - <mainClass>org.apache.vxquery.cli.VXQuery</mainClass> - <name>vxq</name> - </program> - </programs> - <repositoryLayout>flat</repositoryLayout> - <repositoryName>lib</repositoryName> - </configuration> - <phase>package</phase> - <goals> - <goal>assemble</goal> - </goals> - </execution> - </executions> - </plugin> +<project + xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.vxquery</groupId> + <artifactId>apache-vxquery</artifactId> + <version>0.5-SNAPSHOT</version> + </parent> + + <artifactId>apache-vxquery-cli</artifactId> + <packaging>jar</packaging> + <name>VXQuery CLI</name> + <description>Apache VXQuery Command-Line Utility</description> + + <distributionManagement> + <site> + <id>vxquery.website</id> + <name>VXQuery Website</name> + <url>file:../site/vxquery-cli/</url> + </site> + </distributionManagement> + + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>appassembler-maven-plugin</artifactId> + <version>1.3</version> + <executions> + <execution> + <configuration> + <programs> + <program> + <mainClass>org.apache.vxquery.cli.VXQuery</mainClass> + <name>vxq</name> + </program> + </programs> + <repositoryLayout>flat</repositoryLayout> + <repositoryName>lib</repositoryName> + </configuration> + <phase>package</phase> + <goals> + <goal>assemble</goal> + </goals> + </execution> + </executions> + </plugin> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> </plugin> --> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>generate-site</id> - <phase>none</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.apache.vxquery</groupId> - <artifactId>apache-vxquery-core</artifactId> - <version>0.5-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-api</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-client</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-control-cc</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-control-nc</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>algebricks-common</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>algebricks-core</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-control-common</artifactId> - </dependency> - - <dependency> - <groupId>edu.uci.ics.hyracks</groupId> - <artifactId>hyracks-dataflow-std</artifactId> - </dependency> - </dependencies> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - <reportSets> - <reportSet> - <reports> - <report>index</report> - <report>dependencies</report> - <report>plugins</report> - </reports> - </reportSet> - </reportSets> - <configuration> - <linkOnly>true</linkOnly> - <dependencyLocationsEnabled>false</dependencyLocationsEnabled> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.rat</groupId> - <artifactId>apache-rat-plugin</artifactId> - <version>${apache-rat-plugin.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <configuration> - <notimestamp>true</notimestamp> - <maxmemory>2g</maxmemory> - </configuration> - </plugin> - </plugins> - </reporting> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>generate-site</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.apache.vxquery</groupId> + <artifactId>apache-vxquery-core</artifactId> + <version>0.5-SNAPSHOT</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-api</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-client</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-control-cc</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-control-nc</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>algebricks-common</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>algebricks-core</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-control-common</artifactId> + </dependency> + + <dependency> + <groupId>edu.uci.ics.hyracks</groupId> + <artifactId>hyracks-dataflow-std</artifactId> + </dependency> + </dependencies> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <reportSets> + <reportSet> + <reports> + <report>index</report> + <report>dependencies</report> + <report>plugins</report> + </reports> + </reportSet> + </reportSets> + <configuration> + <linkOnly>true</linkOnly> + <dependencyLocationsEnabled>false</dependencyLocationsEnabled> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.rat</groupId> + <artifactId>apache-rat-plugin</artifactId> + <version>${apache-rat-plugin.version}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <configuration> + <notimestamp>true</notimestamp> + <maxmemory>2g</maxmemory> + </configuration> + </plugin> + </plugins> + </reporting> </project> http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java ---------------------------------------------------------------------- diff --git a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java index 866edd1..ca91636 100644 --- a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java +++ b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java @@ -78,7 +78,7 @@ public class VXQuery { private IHyracksDataset hds; private ResultSetId resultSetId; - private static List<String> timingMessages; + private static List<String> timingMessages = new ArrayList<String>(); private static long sumTiming; private static long sumSquaredTiming; private static long minTiming = Long.MAX_VALUE; @@ -92,7 +92,6 @@ public class VXQuery { */ public VXQuery(CmdLineOptions opts) { this.opts = opts; - timingMessages = new ArrayList<String>(); } /** http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java index 8aca4a0..b05e27f 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/atomic/XSDecimalPointable.java @@ -197,7 +197,7 @@ public class XSDecimalPointable extends AbstractPointable implements IHashable, @Override public double doubleValue() { - return getDecimalValue() / Math.pow(10, getDecimalPlace()); + return ((double) getDecimalValue()) / Math.pow(10, getDecimalPlace()); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/AvgGlobalAggregateEvaluatorFactory.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/AvgGlobalAggregateEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/AvgGlobalAggregateEvaluatorFactory.java index 0f4ac08..8d589ed 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/AvgGlobalAggregateEvaluatorFactory.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/AvgGlobalAggregateEvaluatorFactory.java @@ -20,7 +20,6 @@ import java.io.DataOutput; import org.apache.vxquery.datamodel.accessors.SequencePointable; import org.apache.vxquery.datamodel.accessors.TaggedValuePointable; -import org.apache.vxquery.datamodel.accessors.TypedPointables; import org.apache.vxquery.datamodel.values.ValueTag; import org.apache.vxquery.datamodel.values.XDMConstants; import org.apache.vxquery.exceptions.ErrorCode; @@ -30,7 +29,6 @@ import org.apache.vxquery.runtime.functions.arithmetic.DivideOperation; import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentAggregateEvaluator; import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentAggregateEvaluatorFactory; import org.apache.vxquery.runtime.functions.util.ArithmeticHelper; -import org.apache.vxquery.runtime.functions.util.FunctionHelper; import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException; import edu.uci.ics.hyracks.algebricks.runtime.base.IAggregateEvaluator; http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/FnAvgAggregateEvaluatorFactory.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/FnAvgAggregateEvaluatorFactory.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/FnAvgAggregateEvaluatorFactory.java index d89426b..5717174 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/FnAvgAggregateEvaluatorFactory.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/aggregate/FnAvgAggregateEvaluatorFactory.java @@ -20,7 +20,6 @@ import java.io.DataOutput; import java.io.IOException; import org.apache.vxquery.datamodel.accessors.TaggedValuePointable; -import org.apache.vxquery.datamodel.accessors.TypedPointables; import org.apache.vxquery.datamodel.values.ValueTag; import org.apache.vxquery.datamodel.values.XDMConstants; import org.apache.vxquery.exceptions.ErrorCode; @@ -30,7 +29,6 @@ import org.apache.vxquery.runtime.functions.arithmetic.DivideOperation; import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentAggregateEvaluator; import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentAggregateEvaluatorFactory; import org.apache.vxquery.runtime.functions.util.ArithmeticHelper; -import org.apache.vxquery.runtime.functions.util.FunctionHelper; import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException; import edu.uci.ics.hyracks.algebricks.runtime.base.IAggregateEvaluator; http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnCeilingOperation.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnCeilingOperation.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnCeilingOperation.java index 8fb750f..d7579e1 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnCeilingOperation.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnCeilingOperation.java @@ -32,8 +32,8 @@ public class FnCeilingOperation extends AbstractNumericOperation { @Override public void operateDecimal(XSDecimalPointable decp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_DECIMAL_TAG); - dOut.write(decp.getDecimalPlace()); - dOut.writeLong((long) Math.ceil(decp.getDecimalValue())); + dOut.write(0); + dOut.writeLong((long) Math.ceil(decp.doubleValue())); } @Override http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnRoundOperation.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnRoundOperation.java b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnRoundOperation.java index 5d45f86..90e5156 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnRoundOperation.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/numeric/FnRoundOperation.java @@ -32,8 +32,8 @@ public class FnRoundOperation extends AbstractNumericOperation { @Override public void operateDecimal(XSDecimalPointable decp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_DECIMAL_TAG); - dOut.write(decp.getDecimalPlace()); - dOut.writeLong((long) Math.round(decp.getDecimalValue())); + dOut.write(0); + dOut.writeLong(Math.round(decp.doubleValue())); } @Override http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-server/src/main/resources/conf/cluster.properties ---------------------------------------------------------------------- diff --git a/vxquery-server/src/main/resources/conf/cluster.properties b/vxquery-server/src/main/resources/conf/cluster.properties index 9f7d950..107f4a5 100644 --- a/vxquery-server/src/main/resources/conf/cluster.properties +++ b/vxquery-server/src/main/resources/conf/cluster.properties @@ -43,13 +43,13 @@ NCOPTS=" -iodevices /home/ecarman/disk1/tmp/,/home/ecarman/disk2/tmp/ " #NCOPTS=" -iodevices $NCTMP_DIR " #CC JAVA_OPTS -CCJAVA_OPTS="-server -Xmx7G -Djava.util.logging.config.file=./vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/testing_logging.properties" +CCJAVA_OPTS="-server -Xmx500M -Djava.util.logging.config.file=./vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/testing_logging.properties" # debug option: CCJAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=7001,server=y,suspend=n -Xmx1g -Djava.util.logging.config.file=logging.properties" -# Yourkit option: -agentpath:/tools/yjp-10.0.4/bin/linux-x86-64/libyjpagent.so=port=20001" +# Yourkit option: -agentpath:/tools/yjp-2014-build-14114/bin/linux-x86-64/libyjpagent.so=port=20001" # Yourkit mac option: -agentpath:/Applications/YourKit_Java_Profiler.app/bin/mac/libyjpagent.jnilib=sampling #NC JAVA_OPTS NCJAVA_OPTS="-server -Xmx7G -Djava.util.logging.config.file=./vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/testing_logging.properties" # debug option: NCJAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=7002,server=y,suspend=n -Xmx1g -Djava.util.logging.config.file=logging.properties" -# Yourkit option: -agentpath:/tools/yjp-10.0.4/bin/linux-x86-64/libyjpagent.so=port=20001" +# Yourkit option: -agentpath:/tools/yjp-2014-build-14114/bin/linux-x86-64/libyjpagent.so=port=20001" # Yourkit mac option: -agentpath:/Applications/YourKit_Java_Profiler.app/bin/mac/libyjpagent.jnilib=sampling http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:abs.txt ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:abs.txt b/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:abs.txt new file mode 100644 index 0000000..77fbb52 --- /dev/null +++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:abs.txt @@ -0,0 +1,8 @@ +5.5 +5 +5.5 +5.5 +5.5 +5 +5.5 +5.5 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:ceiling.txt ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:ceiling.txt b/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:ceiling.txt new file mode 100644 index 0000000..1c95747 --- /dev/null +++ b/vxquery-xtest/src/test/resources/ExpectedTestResults/Numerics/fn:ceiling.txt @@ -0,0 +1,8 @@ +6 +5 +6 +6 +-5 +-5 +-5 +-5 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:abs.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:abs.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:abs.xq new file mode 100644 index 0000000..44bd08e --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:abs.xq @@ -0,0 +1,22 @@ +(: 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. :) + +(: XQuery fn:abs :) +( + fn:abs(xs:decimal(5.5)), fn:abs(xs:integer(5)), fn:abs(xs:float(5.5)), fn:abs(xs:double(5.5)), + fn:abs(xs:decimal(-5.5)), fn:abs(xs:integer(-5)), fn:abs(xs:float(-5.5)), fn:abs(xs:double(-5.5)) +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:ceiling.xq ---------------------------------------------------------------------- diff --git a/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:ceiling.xq b/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:ceiling.xq new file mode 100644 index 0000000..6a14197 --- /dev/null +++ b/vxquery-xtest/src/test/resources/Queries/XQuery/Numerics/fn:ceiling.xq @@ -0,0 +1,22 @@ +(: 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. :) + +(: XQuery fn:ceiling :) +( + fn:ceiling(xs:decimal(5.5)), fn:ceiling(xs:integer(5)), fn:ceiling(xs:float(5.5)), fn:ceiling(xs:double(5.5)), + fn:ceiling(xs:decimal(-5.5)), fn:ceiling(xs:integer(-5)), fn:ceiling(xs:float(-5.5)), fn:ceiling(xs:double(-5.5)) +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/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 30ebdc5..773c276 100644 --- a/vxquery-xtest/src/test/resources/VXQueryCatalog.xml +++ b/vxquery-xtest/src/test/resources/VXQueryCatalog.xml @@ -22,6 +22,8 @@ <!ENTITY AggregatePartition2Queries SYSTEM "cat/AggregatePartition2Queries.xml"> <!ENTITY AggregatePartition4Queries SYSTEM "cat/AggregatePartition4Queries.xml"> +<!ENTITY FunctionsAndOperatorsOnNumericsQueries SYSTEM "cat/FunctionsAndOperatorsOnNumericsQueries.xml"> + <!ENTITY GhcndPartition1Queries SYSTEM "cat/GhcndPartition1Queries.xml"> <!ENTITY GhcndPartition2Queries SYSTEM "cat/GhcndPartition2Queries.xml"> <!ENTITY GhcndPartition4Queries SYSTEM "cat/GhcndPartition4Queries.xml"> @@ -116,6 +118,19 @@ &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="GhcndPartitionQueries" featureOwner="Preston Carman"> <GroupInfo> <title>GHCND Partition Queries</title> http://git-wip-us.apache.org/repos/asf/vxquery/blob/0ff85572/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 new file mode 100644 index 0000000..e79c514 --- /dev/null +++ b/vxquery-xtest/src/test/resources/cat/FunctionsAndOperatorsOnNumericsQueries.xml @@ -0,0 +1,33 @@ +<!-- + 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="GhcndRecordsPartition1Queries" featureOwner="VXQuery"> + <GroupInfo> + <title>Function and Operators on Numerics</title> + <description/> + </GroupInfo> + <test-case name="functions-and-operators-on-numerics-fn:abs" FilePath="Numerics/" Creator="Preston Carman"> + <description>Query for fn:abs with all numeric types.</description> + <query name="fn:abs" date="2015-01-05"/> + <output-file compare="Text">fn:abs.txt</output-file> + </test-case> + <test-case name="functions-and-operators-on-numerics-fn:ceiling" FilePath="Numerics/" Creator="Preston Carman"> + <description>Query for fn:ceiling with all numeric types.</description> + <query name="fn:ceiling" date="2015-01-05"/> + <output-file compare="Text">fn:ceiling.txt</output-file> + </test-case> +</test-group> \ No newline at end of file
