Class JoinClauseIterator
java.lang.Object
org.rumbledb.runtime.plan.RuntimePlan<FlworTuple>
org.rumbledb.runtime.TupleRuntimePlan
org.rumbledb.runtime.flwor.clauses.JoinClauseIterator
- All Implemented Interfaces:
Serializable,DataFrameRuntimePlan<FlworTuple>,LocalRuntimePlan<FlworTuple>,NativeQueryRuntimePlan
public class JoinClauseIterator
extends TupleRuntimePlan
implements DataFrameRuntimePlan<FlworTuple>
- 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
ConstructorsConstructorDescriptionJoinClauseIterator(TupleRuntimePlan leftChild, TupleRuntimePlan rightChild, boolean isLeftOuterJoin, 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.createNativeDataFrame(DynamicContext context) Builds the DataFrame for one evaluation.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.booleanSays whether this expression evaluation triggers a Spark job.static FlworDataFramejoinInputTupleWithSequenceOnPredicate(DynamicContext context, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> leftInputTuple, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> rightInputTuple, Map<Name, DynamicContext.VariableDependency> outputTupleVariableDependencies, List<Name> variablesInLeftInputTuple, List<Name> variablesInRightInputTuple, ItemRuntimePlan predicateIterator, boolean isLeftOuterJoin, Name newRightSideVariableName, ExceptionMetadata metadata, RuntimeStaticContext staticContext) Joins two input tuples.Methods inherited from class org.rumbledb.runtime.TupleRuntimePlan
canSetEvaluationDepthLimit, generateNativeQuery, getChildIterator, getDynamicContextVariableDependencies, getEvaluationDepthLimit, getHeight, getOutputTupleVariableNames, 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
-
JoinClauseIterator
public JoinClauseIterator(TupleRuntimePlan leftChild, TupleRuntimePlan rightChild, boolean isLeftOuterJoin, 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
-
joinInputTupleWithSequenceOnPredicate
public static FlworDataFrame joinInputTupleWithSequenceOnPredicate(DynamicContext context, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> leftInputTuple, org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> rightInputTuple, Map<Name, DynamicContext.VariableDependency> outputTupleVariableDependencies, List<Name> variablesInLeftInputTuple, List<Name> variablesInRightInputTuple, ItemRuntimePlan predicateIterator, boolean isLeftOuterJoin, Name newRightSideVariableName, ExceptionMetadata metadata, RuntimeStaticContext staticContext) Joins two input tuples. Warning: if the two tuples collide in their columns, unexpected things may happen for now.- Parameters:
context- the dynamic context for the evaluation of the predicate expression.leftInputTuple- the left tuple.rightInputTuple- the right tuple.outputTupleVariableDependencies- the necessary and sufficient variable dependencies that the output tuple should contain.variablesInLeftInputTuple- a list of the variables in the left tuple.variablesInRightInputTuple- a list of the variables in the right tuple.predicateIterator- the predicate iterator.isLeftOuterJoin- true if it is a left outer join, false otherwise.newRightSideVariableName- the new name of the variable to rename the context item in the output (null if no rename).metadata- the metadata.- Returns:
- the joined tuple.
-
createNativeDataFrame
Description copied from interface:DataFrameRuntimePlanBuilds the DataFrame for one evaluation.- Specified by:
createNativeDataFramein interfaceDataFrameRuntimePlan<FlworTuple>- Parameters:
context- the dynamic context for that evaluation- Returns:
- the resulting DataFrame
-
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.
-
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()Says 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.
-