From: <tho...@us...> - 2014-01-10 22:16:38
|
Revision: 7764 http://bigdata.svn.sourceforge.net/bigdata/?rev=7764&view=rev Author: thompsonbry Date: 2014-01-10 22:16:31 +0000 (Fri, 10 Jan 2014) Log Message: ----------- Added a unit test that demonstrates a failure (N" Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpRTO.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/TestRTO_BSBM.java Added Paths: ----------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.rq branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.srx Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpRTO.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpRTO.java 2014-01-10 21:51:38 UTC (rev 7763) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/AST2BOpRTO.java 2014-01-10 22:16:31 UTC (rev 7764) @@ -260,7 +260,17 @@ return left; } + + if (joinGroup.isMinus() || joinGroup.isOptional()) { + /* + * FIXME At least an OPTIONAL join group causes a "No stats" + * assertion error during query evaluation. + */ + return left; + + } + /* * Consider the join group. See if it is complex enough to warrant * running the RTO. Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7.rq 2014-01-10 21:51:38 UTC (rev 7763) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7.rq 2014-01-10 22:16:31 UTC (rev 7764) @@ -1,39 +1,30 @@ -# BSBM Q7 on pc100. - -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> -PREFIX rev: <http://purl.org/stuff/rev#> -PREFIX foaf: <http://xmlns.com/foaf/0.1/> -PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/> -PREFIX dc: <http://purl.org/dc/elements/1.1/> - -SELECT (COUNT(*) as ?count) -#SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle ?review ?revTitle -# ?reviewer ?revName ?rating1 ?rating2 -WHERE { - - # Control all RTO parameters for repeatable behavior. - hint:Query hint:optimizer "Runtime". - hint:Query hint:RTO-sampleType "DENSE". - hint:Query hint:RTO-limit "100". - hint:Query hint:RTO-nedges "1". - - <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> rdfs:label ?productLabel . - OPTIONAL { - ?offer bsbm:product <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . - ?offer bsbm:price ?price . - ?offer bsbm:vendor ?vendor . - ?vendor rdfs:label ?vendorTitle . - ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#DE> . - ?offer dc:publisher ?vendor . - ?offer bsbm:validTo ?date . - FILTER (?date > "2008-06-20T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) - } - OPTIONAL { - ?review bsbm:reviewFor <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . - ?review rev:reviewer ?reviewer . - ?reviewer foaf:name ?revName . - ?review dc:title ?revTitle . - OPTIONAL { ?review bsbm:rating1 ?rating1 . } - OPTIONAL { ?review bsbm:rating2 ?rating2 . } - } -} +# A modified version BSBM Q7 on pc100 which is the simplest form of the +# query that causes the RTO to fail with the "No stats" assertion error. + +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> +PREFIX rev: <http://purl.org/stuff/rev#> +PREFIX foaf: <http://xmlns.com/foaf/0.1/> +PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/> +PREFIX dc: <http://purl.org/dc/elements/1.1/> + +SELECT (COUNT(*) as ?count) +WHERE { + + # Control all RTO parameters for repeatable behavior. + hint:Query hint:RTO-sampleType "DENSE". + hint:Query hint:RTO-limit "100". + hint:Query hint:RTO-nedges "1". + + <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> rdfs:label ?productLabel . + OPTIONAL { + + # Enable the RTO inside of the OPTIONAL join group. + hint:Group hint:optimizer "Runtime". + + ?review bsbm:reviewFor <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . + ?review rev:reviewer ?reviewer . + ?reviewer foaf:name ?revName . + ?review dc:title ?revTitle . + + } +} Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.rq =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.rq (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.rq 2014-01-10 22:16:31 UTC (rev 7764) @@ -0,0 +1,39 @@ +# BSBM Q7 on pc100. + +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> +PREFIX rev: <http://purl.org/stuff/rev#> +PREFIX foaf: <http://xmlns.com/foaf/0.1/> +PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/> +PREFIX dc: <http://purl.org/dc/elements/1.1/> + +SELECT (COUNT(*) as ?count) +#SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle ?review ?revTitle +# ?reviewer ?revName ?rating1 ?rating2 +WHERE { + + # Control all RTO parameters for repeatable behavior. + hint:Query hint:optimizer "Runtime". + hint:Query hint:RTO-sampleType "DENSE". + hint:Query hint:RTO-limit "100". + hint:Query hint:RTO-nedges "1". + + <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> rdfs:label ?productLabel . + OPTIONAL { + ?offer bsbm:product <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . + ?offer bsbm:price ?price . + ?offer bsbm:vendor ?vendor . + ?vendor rdfs:label ?vendorTitle . + ?vendor bsbm:country <http://downlode.org/rdf/iso-3166/countries#DE> . + ?offer dc:publisher ?vendor . + ?offer bsbm:validTo ?date . + FILTER (?date > "2008-06-20T00:00:00"^^<http://www.w3.org/2001/XMLSchema#dateTime> ) + } + OPTIONAL { + ?review bsbm:reviewFor <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . + ?review rev:reviewer ?reviewer . + ?reviewer foaf:name ?revName . + ?review dc:title ?revTitle . + OPTIONAL { ?review bsbm:rating1 ?rating1 . } + OPTIONAL { ?review bsbm:rating2 ?rating2 . } + } +} Added: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.srx =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.srx (rev 0) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/BSBM-Q7b.srx 2014-01-10 22:16:31 UTC (rev 7764) @@ -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="count" /> + </head> + <results> + <result> + <binding name="count"> + <literal datatype="http://www.w3.org/2001/XMLSchema#integer">6</literal> + </binding> + </result> + </results> +</sparql> Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/TestRTO_BSBM.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/TestRTO_BSBM.java 2014-01-10 21:51:38 UTC (rev 7763) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/test/com/bigdata/rdf/sparql/ast/eval/rto/TestRTO_BSBM.java 2014-01-10 22:16:31 UTC (rev 7764) @@ -348,6 +348,61 @@ } /** + * A modified version BSBM Q7 on pc100 which is the simplest form of the + * query that causes the RTO to fail with the "No stats" assertion error. + * This is basically just an OPTIONAL {} join group. + * + * <pre> + * PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> + * PREFIX rev: <http://purl.org/stuff/rev#> + * PREFIX foaf: <http://xmlns.com/foaf/0.1/> + * PREFIX bsbm: <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/> + * PREFIX dc: <http://purl.org/dc/elements/1.1/> + * + * SELECT (COUNT(*) as ?count) + * WHERE { + * + * # Control all RTO parameters for repeatable behavior. + * hint:Query hint:RTO-sampleType "DENSE". + * hint:Query hint:RTO-limit "100". + * hint:Query hint:RTO-nedges "1". + * + * <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> rdfs:label ?productLabel . + * OPTIONAL { + * + * # Enable the RTO inside of the OPTIONAL join group. + * hint:Group hint:optimizer "Runtime". + * + * ?review bsbm:reviewFor <http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/dataFromProducer1/Product7> . + * ?review rev:reviewer ?reviewer . + * ?reviewer foaf:name ?revName . + * ?review dc:title ?revTitle . + * + * } + * } + * </pre> + */ + public void test_BSBM_Q7b_pc100() throws Exception { + + final TestHelper helper = new TestHelper(// + "rto/BSBM-Q7", // testURI, + "rto/BSBM-Q7.rq",// queryFileURL + "bigdata-rdf/src/resources/data/bsbm/dataset_pc100.nt",// dataFileURL + "rto/BSBM-Q7.srx"// resultFileURL + ); + + /* + * Verify that the runtime optimizer produced the expected join path. + */ + + // FIXME The join order is unknown. This query does not run through the RTO yet. + final int[] expected = new int[] { 1, 3, 2, 5, 4, 7, 6 }; + + assertSameJoinOrder(expected, helper); + + } + + /** * BSBM Q8 on the pc100 data set. */ public void test_BSBM_Q8_pc100() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |