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

[11/50] [abbrv] git commit: Added logging to the benchmark script and a new join query.

Added logging to the benchmark script and a new join query.


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

Branch: refs/heads/prestonc/hash_join
Commit: 75d60770ba1d0302c86058d165260c4bcbf8f4bd
Parents: 65c05e0
Author: Preston Carman <pr...@apache.org>
Authored: Thu Mar 13 23:06:48 2014 -0700
Committer: Preston Carman <pr...@apache.org>
Committed: Tue Apr 1 20:56:24 2014 -0700

----------------------------------------------------------------------
 .../main/resources/noaa-ghcn-daily/queries/q07.xq    | 15 +++++++++++++++
 .../noaa-ghcn-daily/scripts/run_benchmark.sh         |  7 +++++--
 .../rewriter/rules/InlineNestedVariablesRule.java    |  4 ++--
 3 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/75d60770/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
new file mode 100644
index 0000000..412285c
--- /dev/null
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/queries/q07.xq
@@ -0,0 +1,15 @@
+(: XQuery Join Aggregate Query :)
+(: Find the lowest recorded temperature (TMIN) for each station 2001.         :)
+let $station_collection := "/tmp/1.0_partition_ghcnd_all_xml/stations"
+for $s in collection($station_collection)/stationCollection/stations
+
+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

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/75d60770/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh
----------------------------------------------------------------------
diff --git a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh
index 8417660..bbfe35d 100644
--- a/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh
+++ b/vxquery-benchmark/src/main/resources/noaa-ghcn-daily/scripts/run_benchmark.sh
@@ -32,12 +32,15 @@ then
     exit
 fi
 
-for j in $(find ${1} -name '*.xq')
+for j in $(find ${1} -name '*q??.xq')
 do
 	if [ -z "${3}" ] || [[ "${j}" =~ "${3}" ]] 
 	then
 		echo "Running query: ${j}"
-		time sh ./vxquery-cli/target/appassembler/bin/vxq ${j} ${2} -timing -showquery -frame-size 1000000 -repeatexec 10 > ${j}.log 2>&1
+		log_file="$(basename ${j}).$(date +%Y%m%d).log"
+		log_base_path=$(dirname ${j/queries/query_logs})
+		mkdir -p ${log_base_path}
+		time sh ./vxquery-cli/target/appassembler/bin/vxq ${j} ${2} -timing -showquery -frame-size 1000000 -repeatexec 10 > ${log_base_path}/${log_file} 2>&1
 	fi;
 done
 

http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/75d60770/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/InlineNestedVariablesRule.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/InlineNestedVariablesRule.java b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/InlineNestedVariablesRule.java
index 8cd86f8..c0c082f 100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/InlineNestedVariablesRule.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/compiler/rewriter/rules/InlineNestedVariablesRule.java
@@ -62,7 +62,7 @@ public class InlineNestedVariablesRule extends InlineVariablesRule {
         }
 
         boolean modified = false;
-        // Descend into nested plans removing projects on the way.
+        // Descend into nested plans inlining along the way.
         if (op.hasNestedPlans()) {
             AbstractOperatorWithNestedPlans nestedOp = (AbstractOperatorWithNestedPlans) op;
             for (ILogicalPlan nestedPlan : nestedOp.getNestedPlans()) {
@@ -74,7 +74,7 @@ public class InlineNestedVariablesRule extends InlineVariablesRule {
             }
         }
 
-        // Descend into children removing projects on the way.
+        // Descend into children inlining along on the way.
         for (Mutable<ILogicalOperator> inputOpRef : op.getInputs()) {
             if (inlineVariables(inputOpRef, context)) {
                 modified = true;