Updated query comments and made mrql queries consistent with vxquery.
Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/db311862 Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/db311862 Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/db311862 Branch: refs/heads/prestonc/benchmark_queries Commit: db31186282bd28ebb8356056df5de2f4a6a1f0fd Parents: d6c52f7 Author: Preston Carman <[email protected]> Authored: Wed Jun 25 18:58:16 2014 -0700 Committer: Preston Carman <[email protected]> Committed: Wed Jun 25 21:23:11 2014 -0700 ---------------------------------------------------------------------- .../main/resources/noaa-ghcn-daily/README.md | 42 ++++++++++++++++++++ .../noaa-ghcn-daily/other_systems/mrql/q03.mrql | 6 +++ .../noaa-ghcn-daily/other_systems/mrql/q04.mrql | 8 ++++ .../resources/noaa-ghcn-daily/queries/q01.xq | 14 ++++--- .../resources/noaa-ghcn-daily/queries/q03.xq | 7 +++- .../noaa-ghcn-daily/scripts/run_mrql_test.sh | 29 ++++++++++++++ 6 files changed, 99 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/README.md ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/README.md b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/README.md new file mode 100644 index 0000000..12dc3b3 --- /dev/null +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/README.md @@ -0,0 +1,42 @@ +<!-- + 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. +--> + +NOAA GHCN-Daily Benchmark +===================== + +# Introduction + +The NOAA has hosted DAILY GLOBAL HISTORICAL CLIMATOLOGY NETWORK (GHCN-DAILY) +.dat files. Weather.gov has an RSS/XML feed that gives current weather sensor +readings. Using the RSS feed as a template, the GHCN-DAILY historical +information is used to generate past RSS feed XML documents. The process allows +testing on a large set of information with out having to continually monitor +the weather.gov site for all the weather details for years. + +# Detailed Description + +Detailed GHDN-DAILY information: +<http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt> + +# Folders + + * conf + * other_systems + * MRQL + * saxon + * queries + * scripts \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q03.mrql ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q03.mrql b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q03.mrql new file mode 100644 index 0000000..981e4c3 --- /dev/null +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q03.mrql @@ -0,0 +1,6 @@ +max( + select (toInt(text(r.value))) + from r in source(xml, "sample_xml/gsn_sensors.xml", {"data"}) + where text(r.dataType) = "TMAX" +) / 10 +; http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q04.mrql ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q04.mrql b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q04.mrql new file mode 100644 index 0000000..7d11b49 --- /dev/null +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q04.mrql @@ -0,0 +1,8 @@ +select (r) +from r in source(xml, "sample_xml/gsn_sensors.xml", {"data"}), + t in source(xml, "sample_xml/gsn_stations.xml", {"station"}), + l in t.locationLabels +where text(t.id) = text(r.station) + and text(r.date) = "1976-07-04T00:00:00.000" + and text(l.displayName) = "WASHINGTON" +; http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q01.xq ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q01.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q01.xq index 0827c45..e26a299 100644 --- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q01.xq +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q01.xq @@ -15,11 +15,15 @@ specific language governing permissions and limitations under the License. :) -(: XQuery Filter Query :) -(: Find all reading for hurricane force wind warning or extreme wind warning. :) -(: The warnings occur when the wind speed (AWND) exceeds 110 mph (49.1744 :) -(: meters per second). (Wind value is in tenth of a meter per second) :) +(: +XQuery Filter Query +------------------- +Find all reading for hurricane force wind warning or extreme wind warning. +The warnings occur when the wind speed (AWND) exceeds 110 mph (49.1744 +meters per second). (Wind value is in tenth of a meter per second) +:) let $collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors" for $r in collection($collection)/dataCollection/data -where $r/dataType eq "AWND" and xs:decimal(fn:data($r/value)) gt 491.744 +where $r/dataType eq "AWND" + and xs:decimal(fn:data($r/value)) gt 491.744 return $r \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q03.xq ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q03.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q03.xq index c58b0a3..bb5656e 100644 --- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q03.xq +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q03.xq @@ -15,8 +15,11 @@ specific language governing permissions and limitations under the License. :) -(: XQuery Aggregate Query :) -(: Find the highest recorded temperature (TMAX) in Celsius. :) +(: +XQuery Aggregate Query +---------------------- +Find the highest recorded temperature (TMAX) in Celsius. +:) fn:max( let $collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors" for $r in collection($collection)/dataCollection/data http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/db311862/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_mrql_test.sh ---------------------------------------------------------------------- diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_mrql_test.sh b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_mrql_test.sh new file mode 100644 index 0000000..dd25c01 --- /dev/null +++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_mrql_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# 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. +# + +export JAVA_HOME=/home/ecarm002/java/jdk1.6.0_45 +REPEAT=${1} + +#for n in `seq 0 7` +for n in 6 +do + date + echo "Running q0${n} for MRQL." + time for i in {1..${REPEAT}}; do ~/mrql/incubator-mrql/bin/mrql -dist -nodes 5 ~/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/other_systems/mrql/q0${n}.mrql > weather_data/mrql/query_logs/gsn/q0${n}.mrql.log 2>&1; done; +done
