From: <mrp...@us...> - 2011-01-20 18:58:16
|
Revision: 4142 http://bigdata.svn.sourceforge.net/bigdata/?rev=4142&view=rev Author: mrpersonick Date: 2011-01-20 18:58:10 +0000 (Thu, 20 Jan 2011) Log Message: ----------- turned constraints into conditional routing ops instead of annotations Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/CompareBOp.java branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/Rule2BOpUtility.java Modified: branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/CompareBOp.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/CompareBOp.java 2011-01-20 17:49:16 UTC (rev 4141) +++ branches/QUADS_QUERY_BRANCH/bigdata-rdf/src/java/com/bigdata/rdf/internal/constraints/CompareBOp.java 2011-01-20 18:58:10 UTC (rev 4142) @@ -89,7 +89,8 @@ final IV right = ((IValueExpression<IV>) get(1)).get(s); if (left == null || right == null) - return true; // not yet bound. +// return true; // not yet bound. + return false; // no longer allow unbound values final CompareOp op = (CompareOp) getProperty(Annotations.OP); Modified: branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/Rule2BOpUtility.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/Rule2BOpUtility.java 2011-01-20 17:49:16 UTC (rev 4141) +++ branches/QUADS_QUERY_BRANCH/bigdata-sails/src/java/com/bigdata/rdf/sail/Rule2BOpUtility.java 2011-01-20 18:58:10 UTC (rev 4142) @@ -620,12 +620,12 @@ // } // just add all the constraints to the very last tail for now - if (i == (order.length-1) && rule.getConstraintCount() > 0) { - final Iterator<IConstraint> it = rule.getConstraints(); - while (it.hasNext()) { - constraints.add(it.next()); - } - } +// if (i == (order.length-1) && rule.getConstraintCount() > 0) { +// final Iterator<IConstraint> it = rule.getConstraints(); +// while (it.hasNext()) { +// constraints.add(it.next()); +// } +// } // annotations for this join. final List<NV> anns = new LinkedList<NV>(); @@ -730,6 +730,24 @@ } + if (rule.getConstraintCount() > 0) { + final Iterator<IConstraint> it = rule.getConstraints(); + while (it.hasNext()) { + final IConstraint c = it.next(); + final int condId = idFactory.incrementAndGet(); + final PipelineOp condOp = applyQueryHints( + new ConditionalRoutingOp(new BOp[]{left}, + NV.asMap(new NV[]{// + new NV(BOp.Annotations.BOP_ID,condId), + new NV(ConditionalRoutingOp.Annotations.CONDITION, c), + })), queryHints); + left = condOp; + if (log.isDebugEnabled()) { + log.debug("adding conditional routing op: " + condOp); + } + } + } + if (log.isInfoEnabled()) { // just for now while i'm debugging log.info("rule=" + rule + ":::query=" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |