public HashJoinIteration(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { this(strategy, join.getLeftArg(), join.getRightArg(), bindings, true); }
@Override public void meet(final LeftJoin leftJoin) { if (leftJoin.getLeftArg().getBindingNames().containsAll(filterVars)) { leftJoin.getLeftArg().visit(this); } else { relocate(filter, leftJoin.getLeftArg()); } }
@Override public void meet(LeftJoin leftJoin) { if (leftJoin.getLeftArg().getBindingNames().containsAll(filterVars)) { leftJoin.getLeftArg().visit(this); } else { relocate(filter, leftJoin); } }
@Override public void meet(LeftJoin leftJoin) { if (leftJoin.getLeftArg().getBindingNames().containsAll(filterVars)) { leftJoin.getLeftArg().visit(this); } else { relocate(filter, leftJoin); } }
@Override public void meet(LeftJoin leftJoin) { leftJoin.getLeftArg().visit(this); Set<String> origBoundVars = boundVars; try { boundVars = new HashSet<String>(boundVars); boundVars.addAll(leftJoin.getLeftArg().getBindingNames()); leftJoin.getRightArg().visit(this); } finally { boundVars = origBoundVars; } }
@Override public void meet(LeftJoin leftJoin) { leftJoin.getLeftArg().visit(this); Set<String> origBoundVars = boundVars; try { boundVars = new HashSet<String>(boundVars); boundVars.addAll(leftJoin.getLeftArg().getBindingNames()); leftJoin.getRightArg().visit(this); } finally { boundVars = origBoundVars; } }
public Set<String> getBindingNames() { Set<String> bindingNames = new LinkedHashSet<String>(16); bindingNames.addAll(getLeftArg().getBindingNames()); bindingNames.addAll(getRightArg().getBindingNames()); return bindingNames; }
public ParallelLeftJoinCursor(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { super(); this.strategy = strategy; this.join = join; this.scopeBindingNames = join.getBindingNames(); this.leftIter = strategy.evaluate(join.getLeftArg(), bindings); }
/** * @inheritDoc */ @Override public void meet(LeftJoin theJoin) throws Exception { binaryOpMeet(theJoin, theJoin.getLeftArg(), theJoin.getRightArg()); }
public ParallelLeftJoinCursor(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; this.scopeBindingNames = join.getBindingNames(); leftIter = strategy.evaluate(join.getLeftArg(), bindings); }
@Override public void meet(LeftJoin node) { node.getLeftArg().visit(this); double leftArgCost = this.cardinality; node.getRightArg().visit(this); cardinality *= leftArgCost; }
public LeftJoinIterator(EvaluationStrategy strategy, LeftJoin join, BindingSet bindings) throws QueryEvaluationException { this.strategy = strategy; this.join = join; this.scopeBindingNames = join.getBindingNames(); leftIter = strategy.evaluate(join.getLeftArg(), bindings); // Initialize with empty iteration so that var is never null rightIter = new EmptyIteration<BindingSet, QueryEvaluationException>(); }
@Override public void meet(LeftJoin node) { node.getLeftArg().visit(this); double leftArgCost = this.cardinality; node.getRightArg().visit(this); cardinality *= leftArgCost; }
@Override public void meet(LeftJoin node) { node.getLeftArg().visit(this); double leftArgCost = this.cardinality; node.getRightArg().visit(this); cardinality *= leftArgCost; }
@Override public void meet(LeftJoin node) throws RuntimeException { node.getLeftArg().visit(this); parts.addLast(new SQLFragment()); if(node.hasCondition()) { parts.getLast().getFilters().add(node.getCondition()); } node.getRightArg().visit(this); }
public FlattenedOptional(LeftJoin node) { rightArgs = getJoinArgs(node.getRightArg(), new HashSet<TupleExpr>()); boundVars = setWithOutConstants( Sets.intersection(node.getLeftArg().getAssuredBindingNames(), node.getRightArg().getBindingNames())); unboundVars = setWithOutConstants(Sets.difference(node.getRightArg().getBindingNames(), boundVars)); condition = node.getCondition(); rightArg = node.getRightArg(); getVarCounts(node); assuredBindingNames = new HashSet<>(leftArgVarCounts.keySet()); bindingNames = new HashSet<>(Sets.union(assuredBindingNames, unboundVars)); }
@Override public void meet(final LeftJoin node) { // Extract the metadata that will be stored for the node. final String leftJoinNodeId = nodeIds.getOrMakeId(node); final QueryModelNode left = node.getLeftArg(); final QueryModelNode right = node.getRightArg(); // Update the metadata for the JoinMetadata.Builder. makeJoinMetadata(leftJoinNodeId, JoinType.LEFT_OUTER_JOIN, left, right); // Walk to the next node. super.meet(node); }
private void addDistinctOwnersNonLocal(LeftJoin node, RepositoryConnection leftOwner, RepositoryConnection rightOwner) { if (leftOwner != null) { node.getLeftArg().replaceWith(new OwnedTupleExpr(leftOwner, node.getLeftArg().clone())); } if (rightOwner != null) { node.getRightArg().replaceWith(new OwnedTupleExpr(rightOwner, node.getRightArg().clone())); } }
@Override public void meet(final LeftJoin n) { final TupleExpr l = n.getLeftArg(); final TupleExpr r = n.getCondition() == null ? n.getRightArg() : // new Filter(n.getRightArg(), n.getCondition()); emit(l); if (!(l instanceof SingletonSet)) { newline(); } emit("OPTIONAL ").emit(r, true); }
@Override public void meet(final LeftJoin n) { final TupleExpr l = n.getLeftArg(); final TupleExpr r = n.getCondition() == null ? n.getRightArg() : // new Filter(n.getRightArg(), n.getCondition()); emit(l); if (!(l instanceof SingletonSet)) { newline(); } emit("OPTIONAL ").emit(r, true); }