|
From: <jer...@us...> - 2014-07-09 19:02:42
|
Revision: 8528
http://sourceforge.net/p/bigdata/code/8528
Author: jeremy_carroll
Date: 2014-07-09 19:02:33 +0000 (Wed, 09 Jul 2014)
Log Message:
-----------
Additional test for trac 988 including a bound variable as well as free variables in the EXIST clause
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-988c.rq
branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.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 15:22:24 UTC (rev 8527)
+++ 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)
@@ -876,5 +876,49 @@
}
}
-
+
+ /**
+ * Performance related test for EXISTS.
+ *
+ * <pre>
+ * prefix eg: <eg:>
+ * SELET DISTINCT ?a
+ * FROM eg:g
+ * { ?a eg:p ?c
+ * 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_988c() throws Exception {
+
+ final long beginNanos = System.nanoTime();
+
+ new TestHelper(
+ "exists-988c", // testURI,
+ "exists-988c.rq",// queryFileURL
+ "exists-988.trig",// dataFileURL
+ "exists-988c.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-988c.rq
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.rq (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.rq 2014-07-09 19:02:33 UTC (rev 8528)
@@ -0,0 +1,11 @@
+prefix eg: <http://www.bigdata.com/>
+
+SELECT DISTINCT ?a
+FROM eg:g
+{ ?a eg:p ?c
+ 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-988c.srx
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.srx (rev 0)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/exists-988c.srx 2014-07-09 19:02:33 UTC (rev 8528)
@@ -0,0 +1,29 @@
+<?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/a</uri></binding>
+ </result>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/b</uri></binding>
+ </result>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/c</uri></binding>
+ </result>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/d</uri></binding>
+ </result>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/e</uri></binding>
+ </result>
+ <result>
+ <binding name="a"><uri>http://www.bigdata.com/f</uri></binding>
+ </result>
+ </results>
+</sparql>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|