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:11:59 UTC

[19/50] [abbrv] git commit: Added join for all stations.

Added join for all stations.


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

Branch: refs/heads/prestonc/hash_join
Commit: 94aa026aa3ced0aea8a9e5902a5c553ded67b1b8
Parents: 491e591
Author: Preston Carman <pr...@apache.org>
Authored: Fri Mar 14 11:36:09 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:24 2014 -0700

----------------------------------------------------------------------
 .../resources/noaa-ghcn-daily/queries/q07.xq    | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/94aa026a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq
index 412285c..c4e186d 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq
@@ -1,15 +1,13 @@
 (: XQuery Join Aggregate Query :)
-(: Find the lowest recorded temperature (TMIN) for each station 2001.         :)
+(: Find the lowest recorded temperature (TMIN) for each station on 2000-01-01.:)
 let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
-for $s in collection($station_collection)/stationCollection/stations
+for $s in collection($station_collection)/stationCollection/station
 
-return fn:min(
-    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
-    for $r in collection($sensor_collection)/dataCollection/data
-    
-    let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
-    where $s/id eq $r/station
-        and $r/dataType eq "TMIN" 
-        and fn:year-from-date($date) eq 2001
-    return $r/value
-) div 10
\ No newline at end of file
+let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+for $r in collection($sensor_collection)/dataCollection/data
+
+let $date := xs:date(fn:substring(xs:string(fn:data($r/date)), 0, 11))
+where $s/id eq $r/station
+    and $r/dataType eq "TMAX" 
+    and $date eq xs:date("2000-01-01")
+return ($s/displayName, $r/value)
\ No newline at end of file