public class SubqueryOp extends PipelineOp
For each binding set presented, this operator executes a subquery. Any
solutions produced by the subquery are copied to the default sink. If no
solutions are produced and
then the original binding set is copied to the default sink (optional join
semantics). Each subquery is run as a separate query but will be cancelled if
the parent query is cancelled.
This operator does not use internal parallelism, but it is thread-safe and multiple instances of this operator may be run in parallel by the query engine for parallel evaluation of different binding set chunks flowing through the pipeline. However, there are much more efficient query plan patterns for most use cases. E.g., (a) creating a hash index with all source solutions, (b) flooding a sub-section of the query plan with the source solutions from the hash index; and (c) hash joining the solutions from the sub-section of the query plan back against the hash index to reunite the solutions from the subquery with those in the parent context.
If there are variables in scope in the parent query which are not projected by the subquery but which appear in the subquery as well, then such variables in the subquery are effectively distinct from those having the same name which appear in the parent query. In order to have correct bottom-up evaluation semantics under these conditions. This is handled by "projecting" only those variables into the subquery which it will project out.
There are a few cases where it may make sense to use the non-vectored operator. For example, for EXISTS where LIMIT ONE can be imposed on the subquery. However, there can still be cases where the vectored sub-plan is more efficient.
|Modifier and Type||Class and Description|
|Constructor and Description|
Shallow copy constructor.
Deep copy constructor.
|Modifier and Type||Method and Description|
assertAtOnceJavaHeapOp, assertMaxParallelOne, getChunkCapacity, getChunkOfChunksCapacity, getChunkTimeout, getMaxMemory, getMaxParallel, isAtOnceEvaluation, isBlockedEvaluation, isLastPassRequested, isPipelinedEvaluation, isReorderSolutions, isSharedState, newStats
__replaceArg, _clearProperty, _set, _setProperty, annotations, annotationsCopy, annotationsEqual, annotationsRef, argIterator, args, argsCopy, arity, clearAnnotations, clearProperty, deepCopy, deepCopy, get, getProperty, setArg, setProperty, setUnboundProperty, toArray, toArray
annotationsEqual, annotationsToString, annotationsToString, annotationValueToString, checkArgs, clone, equals, getEvaluationContext, getId, getProperty, getRequiredProperty, hashCode, indent, isController, mutation, shortenName, toShortString, toString, toString
public SubqueryOp(SubqueryOp op)
public FutureTask<Void> eval(BOpContext<IBindingSet> context)
FutureTaskwhich computes the operator against the evaluation context. The caller is responsible for executing the
FutureTask(this gives them the ability to hook the completion of the computation).
Copyright © 2006–2016 SYSTAP, LLC DBA Blazegraph. All rights reserved.