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 2014/04/02 06:12:13 UTC
[33/50] [abbrv] git commit: Updated queries to use larger dataset
with minimal output.
Updated queries to use larger dataset with minimal output.
Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/43b6a2cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/43b6a2cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/43b6a2cf
Branch: refs/heads/prestonc/hash_join
Commit: 43b6a2cf8915b9ef0bdf07cc1cc866b513831326
Parents: f9932ab
Author: Preston Carman <pr...@apache.org>
Authored: Mon Mar 17 22:41:44 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:25 2014 -0700
----------------------------------------------------------------------
.../resources/noaa-ghcn-daily/queries/q04.xq | 4 +--
.../noaa-ghcn-daily/queries/q04_station.xq | 4 +--
.../resources/noaa-ghcn-daily/queries/q05.xq | 4 +--
.../noaa-ghcn-daily/queries/q05_station.xq | 4 +--
.../resources/noaa-ghcn-daily/queries/q06.xq | 26 +++++++++++---------
5 files changed, 22 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/43b6a2cf/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
index f0ff178..19d5093 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04.xq
@@ -1,5 +1,5 @@
(: XQuery Join Query :)
-(: Find all the weather readings for King county for a specific day :)
+(: Find all the weather readings for Washington state for a specific day :)
(: 1976/7/4. :)
let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
for $s in collection($station_collection)/stationCollection/station
@@ -8,6 +8,6 @@ let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
for $r in collection($sensor_collection)/dataCollection/data
where $s/id eq $r/station
- and (some $x in $s/locationLabels satisfies ($x/type eq "CNTY" and fn:contains(fn:upper-case(fn:data($x/displayName)), "KING")))
+ and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "WASHINGTON"))
and xs:dateTime(fn:data($r/date)) eq xs:dateTime("1976-07-04T00:00:00.000")
return $r
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/43b6a2cf/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
index c9effde..100d2b3 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
@@ -1,8 +1,8 @@
(: XQuery Join Query :)
-(: Count all the weather stations for King county. :)
+(: Count all the weather stations for Washington state. :)
count(
let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
for $s in collection($station_collection)/stationCollection/station
- where (some $x in $s/locationLabels satisfies ($x/type eq "CNTY" and fn:contains(fn:upper-case(fn:data($x/displayName)), "KING")))
+ where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "WASHINGTON"))
return $s
)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/43b6a2cf/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05.xq
index 366eaff..44db96d 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05.xq
@@ -1,5 +1,5 @@
(: XQuery Join Aggregate Query :)
-(: Find the lowest recorded temperature (TMIN) in the state of Oregon for :)
+(: Find the lowest recorded temperature (TMIN) in the United States for :)
(: 2001. :)
fn:min(
let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
@@ -9,7 +9,7 @@ fn:min(
for $r in collection($sensor_collection)/dataCollection/data
where $s/id eq $r/station
- and (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "OREGON"))
+ and (some $x in $s/locationLabels satisfies ($x/type eq "CNTRY" and $x/id eq "FIPS:US"))
and $r/dataType eq "TMIN"
and fn:year-from-dateTime(xs:dateTime(fn:data($r/date))) eq 2001
return $r/value
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/43b6a2cf/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
index c01f386..ee26d88 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
@@ -1,8 +1,8 @@
(: XQuery Join Aggregate Query :)
-(: Count all stations in the state of Oregon. :)
+(: Count all stations in the United States. :)
count(
let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
for $s in collection($station_collection)/stationCollection/station
- where (some $x in $s/locationLabels satisfies ($x/type eq "ST" and fn:upper-case(fn:data($x/displayName)) eq "OREGON"))
+ where (some $x in $s/locationLabels satisfies ($x/type eq "CNTRY" and $x/id eq "FIPS:US"))
return $s
)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/43b6a2cf/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq
index 0d0a4ba..d8eb815 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq
@@ -1,14 +1,16 @@
(: XQuery Self Join Query :)
(: Self join with all stations finding the difference in min and max :)
-(: temperature. :)
-let $sensor_collection_min := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-for $r_min in collection($sensor_collection_min)/dataCollection/data
-
-let $sensor_collection_max := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-for $r_max in collection($sensor_collection_max)/dataCollection/data
-
-where $r_min/station eq $r_max/station
- and $r_min/date eq $r_max/date
- and $r_min/dataType eq "TMIN"
- and $r_max/dataType eq "TMAX"
-return ($r_max/value, $r_min/value, $r_max/value - $r_min/value)
\ No newline at end of file
+(: temperature and get the average. :)
+fn:avg(
+ let $sensor_collection_min := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+ for $r_min in collection($sensor_collection_min)/dataCollection/data
+
+ let $sensor_collection_max := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+ for $r_max in collection($sensor_collection_max)/dataCollection/data
+
+ where $r_min/station eq $r_max/station
+ and $r_min/date eq $r_max/date
+ and $r_min/dataType eq "TMIN"
+ and $r_max/dataType eq "TMAX"
+ return $r_max/value - $r_min/value
+) div 10
\ No newline at end of file