JVMDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( JVMDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars)); ctx.queryId, "--distinct-"+ctx.nextId(), projectionVars); HTreeDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( HTreeDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars));
JVMDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( JVMDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars)); ctx.queryId, "--distinct-"+ctx.nextId(), projectionVars); HTreeDistinctBindingSetsOp.Annotations.BOP_ID, ctx.nextId())); anns.add(new NV( HTreeDistinctBindingSetsOp.Annotations.VARIABLES, projectionVars));
new NV(VariableUnificationOp.Annotations.VARS, new IVariable[] { targetVar, tmpVar }), new NV(BOp.Annotations.BOP_ID, ctx.nextId()));
args[2] = sp.o().getValueExpression(); if (isQuads) { args[3] = sp.c() == null ? Var.var("--anon-" + context.nextId()) : sp .c().getValueExpression();
args[2] = sp.o().getValueExpression(); if (isQuads) { args[3] = sp.c() == null ? Var.var("--anon-" + context.nextId()) : sp .c().getValueExpression();
new NV(VariableUnificationOp.Annotations.VARS, new IVariable[] { targetVar, tmpVar }), new NV(BOp.Annotations.BOP_ID, ctx.nextId()));
/** * Adds a {@link StartOp}. * <p> * Note: {@link StartOp} is not necessary in query plans. It is just a * convenient concept. When not using {@link StartOp}, the first operator in * the plan just needs to have an empty <code>args[]</code>. The only time * this is really necessary is when the top-level query plan would otherwise * be empty (a <code>null</code>). In this case, the {@link StartOp} just * copies its inputs to its outputs (which is all it ever does). * * @return The {@link StartOp}. */ private static final PipelineOp addStartOp(final QueryBase queryBase, final AST2BOpContext ctx) { final PipelineOp start = applyQueryHints( new StartOp(BOp.NOARGS, NV.asMap(new NV[] {// new NV(Predicate.Annotations.BOP_ID, ctx .nextId()), new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER), })), queryBase, ctx); return start; }
/** * Adds a {@link StartOp}. * <p> * Note: {@link StartOp} is not necessary in query plans. It is just a * convenient concept. When not using {@link StartOp}, the first operator in * the plan just needs to have an empty <code>args[]</code>. The only time * this is really necessary is when the top-level query plan would otherwise * be empty (a <code>null</code>). In this case, the {@link StartOp} just * copies its inputs to its outputs (which is all it ever does). * * @return The {@link StartOp}. */ private static final PipelineOp addStartOp(final QueryBase queryBase, final AST2BOpContext ctx) { final PipelineOp start = applyQueryHints( new StartOp(BOp.NOARGS, NV.asMap(new NV[] {// new NV(Predicate.Annotations.BOP_ID, ctx .nextId()), new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER), })), queryBase, ctx); return start; }
new NV(DataSetJoin.Annotations.BOP_ID, ctx.nextId()),// new NV(DataSetJoin.Annotations.GRAPHS, ivs) // }));
new NV(DataSetJoin.Annotations.BOP_ID, ctx.nextId()),// new NV(DataSetJoin.Annotations.GRAPHS, ivs) // }));
new NV(MockTermResolverOp.Annotations.TIMESTAMP, timestamp), // new NV(PipelineOp.Annotations.SHARED_STATE, !ctx.isCluster()),// live stats, but not on the cluster. new NV(BOp.Annotations.BOP_ID, ctx.nextId())// ), queryHints, ctx);
new NV(MockTermResolverOp.Annotations.TIMESTAMP, timestamp), // new NV(PipelineOp.Annotations.SHARED_STATE, !ctx.isCluster()),// live stats, but not on the cluster. new NV(BOp.Annotations.BOP_ID, ctx.nextId())// ), queryHints, ctx);
NV.asMap( new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
NV.asMap( new NV(BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
/** * Generate the query plan for a zero length path. */ private static PipelineOp convertZeroLengthPath(PipelineOp left, final ZeroLengthPathNode zlpNode, final Set<IVariable<?>> doneSet, final AST2BOpContext ctx) { final IVariableOrConstant<?> leftTerm = (IVariableOrConstant<?>) zlpNode.left().getValueExpression(); final IVariableOrConstant<?> rightTerm = (IVariableOrConstant<?>) zlpNode.right().getValueExpression(); left = applyQueryHints(new ZeroLengthPathOp(leftOrEmpty(left),// new NV(ZeroLengthPathOp.Annotations.LEFT_TERM, leftTerm), new NV(ZeroLengthPathOp.Annotations.RIGHT_TERM, rightTerm), new NV(Predicate.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER)// ), zlpNode, ctx); return left; }
/** * Generate the query plan for a zero length path. */ private static PipelineOp convertZeroLengthPath(PipelineOp left, final ZeroLengthPathNode zlpNode, final Set<IVariable<?>> doneSet, final AST2BOpContext ctx) { final IVariableOrConstant<?> leftTerm = (IVariableOrConstant<?>) zlpNode.left().getValueExpression(); final IVariableOrConstant<?> rightTerm = (IVariableOrConstant<?>) zlpNode.right().getValueExpression(); left = applyQueryHints(new ZeroLengthPathOp(leftOrEmpty(left),// new NV(ZeroLengthPathOp.Annotations.LEFT_TERM, leftTerm), new NV(ZeroLengthPathOp.Annotations.RIGHT_TERM, rightTerm), new NV(Predicate.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER)// ), zlpNode, ctx); return left; }
BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
BOp.Annotations.BOP_ID, ctx.nextId()),// new NV(BOp.Annotations.EVALUATION_CONTEXT,
/** * Impose an OFFSET and/or LIMIT on a query. */ private static final PipelineOp addSlice(PipelineOp left, final QueryBase queryBase, final SliceNode slice, final AST2BOpContext ctx) { final int bopId = ctx.nextId(); left = applyQueryHints(new SliceOp(leftOrEmpty(left),// new NV(SliceOp.Annotations.BOP_ID, bopId),// new NV(SliceOp.Annotations.OFFSET, slice.getOffset()),// new NV(SliceOp.Annotations.LIMIT, slice.getLimit()),// new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER),// new NV(SliceOp.Annotations.PIPELINED, true),// new NV(SliceOp.Annotations.MAX_PARALLEL, 1),// new NV(SliceOp.Annotations.REORDER_SOLUTIONS,false),// new NV(SliceOp.Annotations.SHARED_STATE, true)// ), queryBase, ctx); return left; }
/** * Impose an OFFSET and/or LIMIT on a query. */ private static final PipelineOp addSlice(PipelineOp left, final QueryBase queryBase, final SliceNode slice, final AST2BOpContext ctx) { final int bopId = ctx.nextId(); left = applyQueryHints(new SliceOp(leftOrEmpty(left),// new NV(SliceOp.Annotations.BOP_ID, bopId),// new NV(SliceOp.Annotations.OFFSET, slice.getOffset()),// new NV(SliceOp.Annotations.LIMIT, slice.getLimit()),// new NV(SliceOp.Annotations.EVALUATION_CONTEXT, BOpEvaluationContext.CONTROLLER),// new NV(SliceOp.Annotations.PIPELINED, true),// new NV(SliceOp.Annotations.MAX_PARALLEL, 1),// new NV(SliceOp.Annotations.REORDER_SOLUTIONS,false),// new NV(SliceOp.Annotations.SHARED_STATE, true)// ), queryBase, ctx); return left; }