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/4f061948
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/4f061948
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/4f061948

Branch: refs/heads/prestonc/hash_join
Commit: 4f061948d4994d36772c5f4202b99d61f3676bb8
Parents: e9805a6
Author: Preston Carman <[email protected]>
Authored: Fri Mar 14 11:36:09 2014 -0700
Committer: Preston Carman <[email protected]>
Committed: Fri Mar 14 11:36:09 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/4f061948/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

Reply via email to