From: <tho...@us...> - 2011-01-20 21:40:13
|
Revision: 4146 http://bigdata.svn.sourceforge.net/bigdata/?rev=4146&view=rev Author: thompsonbry Date: 2011-01-20 21:40:07 +0000 (Thu, 20 Jan 2011) Log Message: ----------- Counting solutions which join before applying the filter fixed the 1st and 3rd of these queries. Also applying the filter to the original solution in the case where we output the original solution if the optional join failed fixes the middle query, so all three are good now. http://www.w3.org/2001/sw/DataAccess/tests/data-r2/bound/manifest#dawg-bound-query-001 http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional-filter/manifest#dawg-optional-filter-002 http://www.w3.org/2001/sw/DataAccess/tests/data-r2/optional-filter/manifest#dawg-optional-filter-003 Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2011-01-20 19:49:12 UTC (rev 4145) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/bop/join/PipelineJoin.java 2011-01-20 21:40:07 UTC (rev 4146) @@ -1684,16 +1684,11 @@ final IBindingSet bs = bindingSets[bindex]; - if (constraints != null) { - - // verify constraint. - if(!BOpUtility.isConsistent(constraints, bs)) { - // skip solutions which fail the constraint. - continue; - } - - } - + if(!BOpUtility.isConsistent(constraints, bs)) { + // Failed by the constraint on the join. + continue; + } + if (log.isTraceEnabled()) log .trace("Passing on solution which fails an optional join: " @@ -2077,6 +2072,21 @@ int bindex = 0; for (IBindingSet bset : bindingSets) { + // #of binding sets accepted. + naccepted++; + + /* #of elements accepted for this binding set. + * + * Note: We count binding sets as accepted before we + * apply the constraints. This has the effect that + * an optional join which produces solutions that + * are then rejected by a FILTER associated with the + * optional predicate WILL NOT pass on the original + * solution even if ALL solutions produced by the + * join are rejected by the filter. + */ + this.naccepted[bindex]++; + /* * Clone the binding set since it is tested for each * element visited. @@ -2098,15 +2108,12 @@ // Accept this binding set. unsyncBuffer.add(bset); - // #of binding sets accepted. - naccepted++; +// // #of binding sets accepted. +// naccepted++; // #of output solutions generated. stats.outputSolutions.increment(); - // #of elements accepted for this binding set. - this.naccepted[bindex]++; - } bindex++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |