Class WindowClauseIterator
java.lang.Object
org.rumbledb.runtime.plan.RuntimePlan<FlworTuple>
org.rumbledb.runtime.TupleRuntimePlan
org.rumbledb.runtime.flwor.clauses.WindowClauseIterator
- All Implemented Interfaces:
Serializable,LocalRuntimePlan<FlworTuple>,NativeQueryRuntimePlan
- See Also:
-
Field Summary
Fields inherited from class org.rumbledb.runtime.TupleRuntimePlan
child, evaluationDepthLimit, inputTupleProjection, outputTupleProjectionFields inherited from class org.rumbledb.runtime.plan.RuntimePlan
staticContext -
Constructor Summary
ConstructorsConstructorDescriptionWindowClauseIterator(TupleRuntimePlan child, WindowClause clause, ItemRuntimePlan sourceIterator, ItemRuntimePlan startCondition, ItemRuntimePlan endCondition, RuntimeStaticContext staticContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsClause(FLWOR_CLAUSES kind) Says whether or not the clause and its descendants include a clause of the specified kind.createNativeCursor(DynamicContext context) Creates an independent cursor for one native local evaluation.Variable dependencies are variables that MUST be provided by the parent clause in the dynamic context for successful execution of this clause.protected Map<Name,DynamicContext.VariableDependency> getInputTupleVariableDependencies(Map<Name, DynamicContext.VariableDependency> parentProjection) Builds the DataFrame projection that this clause needs to receive from its child clause.Reports all variables available after the window clausebooleanSays whether this expression evaluation triggers a Spark job.Methods inherited from class org.rumbledb.runtime.TupleRuntimePlan
canSetEvaluationDepthLimit, generateNativeQuery, getChildIterator, getEvaluationDepthLimit, getHeight, getStaticContext, getSubtreeBeyondLimit, isDataFrame, print, setEvaluationDepthLimit, setInputAndOutputTupleVariableDependencies, toStringMethods inherited from class org.rumbledb.runtime.plan.RuntimePlan
getConfiguration, getCursor, getDataFrame, getMetadata, getRDD, getRuntimeStaticContext, materialize, materializeAtMost, materializeAtMostOne, materializeExactlyOne, materializeFirstOrNull
-
Constructor Details
-
WindowClauseIterator
public WindowClauseIterator(TupleRuntimePlan child, WindowClause clause, ItemRuntimePlan sourceIterator, ItemRuntimePlan startCondition, ItemRuntimePlan endCondition, RuntimeStaticContext staticContext)
-
-
Method Details
-
createNativeCursor
Description copied from interface:LocalRuntimePlanCreates an independent cursor for one native local evaluation.- Specified by:
createNativeCursorin interfaceLocalRuntimePlan<FlworTuple>- Specified by:
createNativeCursorin classTupleRuntimePlan- Parameters:
context- the dynamic context for that evaluation- Returns:
- an unopened cursor
-
getDynamicContextVariableDependencies
Description copied from class:TupleRuntimePlanVariable dependencies are variables that MUST be provided by the parent clause in the dynamic context for successful execution of this clause. These variables are: 1. All variables that the expression of the clause depends on (recursive call of getVariableDependencies on the expression) 2. Except those variables bound in the current FLWOR (obtained from the auxiliary method getVariablesBoundInCurrentFLWORExpression), because those are provided in the Tuples 3. Plus (recursively calling getVariableDependencies) all the Variable Dependencies of the child clause if it exists.- Overrides:
getDynamicContextVariableDependenciesin classTupleRuntimePlan- Returns:
- a map of variable names to dependencies (FULL, COUNT, ...) that this clause needs to obtain from the dynamic context.
-
getInputTupleVariableDependencies
protected Map<Name,DynamicContext.VariableDependency> getInputTupleVariableDependencies(Map<Name, DynamicContext.VariableDependency> parentProjection) Description copied from class:TupleRuntimePlanBuilds the DataFrame projection that this clause needs to receive from its child clause. The intent is that the result of this method is forwarded to the child clause in getDataFrame() so it can optimize some values away. Invariant: all keys in getInputTupleVariableDependencies(...) MUST be output tuple variables, i.e., appear in this.child.getOutputTupleVariableNames()- Specified by:
getInputTupleVariableDependenciesin classTupleRuntimePlan- Parameters:
parentProjection- the projection needed by the parent clause.- Returns:
- the projection needed by this clause.
-
getOutputTupleVariableNames
Reports all variables available after the window clause- Overrides:
getOutputTupleVariableNamesin classTupleRuntimePlan- Returns:
- the set of variable names that are bound by descendant clauses.
-
containsClause
Description copied from class:TupleRuntimePlanSays whether or not the clause and its descendants include a clause of the specified kind.- Specified by:
containsClausein classTupleRuntimePlan- Parameters:
kind- the kind of clause to test for.- Returns:
- true if there is one. False otherwise.
-
isSparkJobNeeded
public boolean isSparkJobNeeded()Description copied from class:TupleRuntimePlanSays whether this expression evaluation triggers a Spark job.- Specified by:
isSparkJobNeededin classTupleRuntimePlan- Returns:
- true if the execution triggers a Spark, false otherwise, null if undetermined yet.
-