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:55 UTC

[15/50] [abbrv] git commit: Added some support queries to help understand the join condition.

Added some support queries to help understand the join condition.


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

Branch: refs/heads/prestonc/hash_join
Commit: 65c05e032eb3126570dda77cfec37ae176c2a18c
Parents: f8049b7
Author: Preston Carman <pr...@apache.org>
Authored: Thu Mar 13 14:30:13 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:24 2014 -0700

----------------------------------------------------------------------
 .../resources/noaa-ghcn-daily/queries/q04_sensor.xq   | 10 ++++++++++
 .../resources/noaa-ghcn-daily/queries/q04_station.xq  |  8 ++++++++
 .../resources/noaa-ghcn-daily/queries/q05_sensor.xq   | 11 +++++++++++
 .../resources/noaa-ghcn-daily/queries/q05_station.xq  |  8 ++++++++
 .../src/main/resources/noaa-ghcn-daily/queries/q06.xq | 14 ++++++++++++++
 .../resources/noaa-ghcn-daily/queries/q06_sensor.xq   |  9 +++++++++
 .../resources/noaa-ghcn-daily/queries/sensor_count.xq |  7 +++++++
 .../noaa-ghcn-daily/queries/station_count.xq          |  7 +++++++
 8 files changed, 74 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
new file mode 100644
index 0000000..7a94332
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_sensor.xq
@@ -0,0 +1,10 @@
+(: XQuery Join Query :)
+(: Count all the weather sensor readings on 1976-07-04.                       :)
+count(
+    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 $date eq xs:date("1976-07-04")
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/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
new file mode 100644
index 0000000..c9effde
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q04_station.xq
@@ -0,0 +1,8 @@
+(: XQuery Join Query :)
+(: Count all the weather stations for King county.                            :)
+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")))
+    return $s
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
new file mode 100644
index 0000000..5f96d1b
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_sensor.xq
@@ -0,0 +1,11 @@
+(: XQuery Join Aggregate Query :)
+(: Count all sensor readings for TMIN in 2001.                                :)
+count(
+    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 $r/dataType eq "TMIN" 
+        and fn:year-from-date($date) eq 2001
+    return $r/value
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/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
new file mode 100644
index 0000000..c01f386
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q05_station.xq
@@ -0,0 +1,8 @@
+(: XQuery Join Aggregate Query :)
+(: Count all stations in the state of Oregon.                                 :)
+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"))
+    return $s
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/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
new file mode 100644
index 0000000..02dc9ab
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06.xq
@@ -0,0 +1,14 @@
+(: XQuery Join Aggregate Query :)
+(: Self join with all stations.                                               :)
+let $sensor_collection1 := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+for $r1 in collection($sensor_collection1)/dataCollection/data
+
+let $sensor_collection2 := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+for $r2 in collection($sensor_collection2)/dataCollection/data
+
+let $date1 := xs:date(fn:substring(xs:string(fn:data($r1/date)), 0, 11))
+let $date2 := xs:date(fn:substring(xs:string(fn:data($r2/date)), 0, 11))
+where $r1/station eq $r2/station
+    and fn:year-from-date($date1) gt 2000
+    and fn:year-from-date($date2) gt 2000
+return ($r1/value, $r2/value) 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
new file mode 100644
index 0000000..7767b7c
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q06_sensor.xq
@@ -0,0 +1,9 @@
+(: XQuery Join Aggregate Query :)
+(: Count all sensor readings after 2000.                                      :)
+count(
+    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 fn:year-from-date($date) gt 2000
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/sensor_count.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/sensor_count.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/sensor_count.xq
new file mode 100644
index 0000000..b671d31
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/sensor_count.xq
@@ -0,0 +1,7 @@
+(: XQuery Join Query :)
+(: Count all the weather sensor readings available.                           :)
+count(
+    let $sensor_collection := "/tmp/1.0_partition_ghcnd_all_xml/sensors"
+    for $r in collection($sensor_collection)/dataCollection/data
+    return $r
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/65c05e03/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/station_count.xq
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/station_count.xq b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/station_count.xq
new file mode 100644
index 0000000..4f8a666
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/station_count.xq
@@ -0,0 +1,7 @@
+(: XQuery Join Query :)
+(: Count all the weather stations available.                                  :)
+count(
+    let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+    for $s in collection($station_collection)/stationCollection/station
+    return $s
+)
\ No newline at end of file