|
From: <jer...@us...> - 2014-07-09 19:02:58
|
Revision: 8529
http://sourceforge.net/p/bigdata/code/8529
Author: jeremy_carroll
Date: 2014-07-09 19:02:50 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
Also a case where the filter must reject a solution
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNegation.java
Added Paths:
-----------
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.rq
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.srx
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNegation.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNegation.java 2014-07-09 19:02:33 UTC (rev 8528)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/TestNegation.java 2014-07-09 19:02:50 UTC (rev 8529)
@@ -921,4 +921,50 @@
}
}
+ /**
+ * Performance related test for EXISTS.
+ *
+ * <pre>
+ * prefix eg: <eg:>
+ * SELET DISTINCT ?a
+ * FROM eg:g
+ * { { BIND( eg:d as ?a ) }
+ * UNION
+ * { BIND ( eg:z as ?a ) }
+ * FILTER EXISTS {
+ * ?a eg:p/eg:p/eg:p/eg:p/eg:p/eg:p/eg:p/eg:p ?b
+ * }
+ * }
+ *
+ * <pre>
+ *
+ * @throws Exception
+ *
+ * @see <a href="http://trac.bigdata.com/ticket/988"> bad
+ * performance for FILTER EXISTS </a>
+ */
+ public void test_exists_988d() throws Exception {
+
+ final long beginNanos = System.nanoTime();
+
+ new TestHelper(
+ "exists-988d", // testURI,
+ "exists-988d.rq",// queryFileURL
+ "exists-988.trig",// dataFileURL
+ "exists-988d.srx" // resultFileURL,
+// false, // laxCardinality
+// true // checkOrder
+ ).runTest();
+
+ final long elapsedNanos = System.nanoTime() - beginNanos;
+
+ final long timeoutNanos = TimeUnit.MILLISECONDS.toNanos(1500);
+
+ if (timeoutNanos < elapsedNanos) {
+
+ fail("Timeout exceeded: Query hint not recognized?");
+
+ }
+
+ }
}
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.rq
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.rq (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.rq 2014-07-09 19:02:50 UTC (rev 8529)
@@ -0,0 +1,13 @@
+prefix eg: <http://www.bigdata.com/>
+
+SELECT DISTINCT ?a
+FROM eg:g
+{ { BIND( eg:d as ?a ) }
+ UNION
+ { BIND ( eg:z as ?a ) }
+ FILTER EXISTS {
+ ?a eg:p/eg:p/eg:p/eg:p/eg:p/eg:p/eg:p/eg:p ?b .
+ # Note: Query hint specifies sub-query LIMIT ONE plan.
+ hint:SubQuery hint:filterExists "SubQueryLimitOne" .
+ }
+}
\ No newline at end of file
Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.srx
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.srx (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988d.srx 2014-07-09 19:02:50 UTC (rev 8529)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<sparql
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema#"
+ xmlns="http://www.w3.org/2005/sparql-results#" >
+ <head>
+ <variable name="a"/>
+ </head>
+ <results>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/d</uri></binding>
+ </result>
+ </results>
+</sparql>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|