Class JoinClauseIterator

All Implemented Interfaces:
Serializable, DataFrameRuntimePlan<FlworTuple>, LocalRuntimePlan<FlworTuple>, NativeQueryRuntimePlan

public class JoinClauseIterator extends TupleRuntimePlan implements DataFrameRuntimePlan<FlworTuple>
See Also:
  • Constructor Details

  • Method Details

    • createNativeCursor

      public Cursor<FlworTuple> createNativeCursor(DynamicContext context)
      Description copied from interface: LocalRuntimePlan
      Creates an independent cursor for one native local evaluation.
      Specified by:
      createNativeCursor in interface LocalRuntimePlan<FlworTuple>
      Specified by:
      createNativeCursor in class TupleRuntimePlan
      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

      public FlworDataFrame createNativeDataFrame(DynamicContext context)
      Description copied from interface: DataFrameRuntimePlan
      Builds the DataFrame for one evaluation.
      Specified by:
      createNativeDataFrame in interface DataFrameRuntimePlan<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: TupleRuntimePlan
      Builds 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:
      getInputTupleVariableDependencies in class TupleRuntimePlan
      Parameters:
      parentProjection - the projection needed by the parent clause.
      Returns:
      the projection needed by this clause.
    • containsClause

      public boolean containsClause(FLWOR_CLAUSES kind)
      Description copied from class: TupleRuntimePlan
      Says whether or not the clause and its descendants include a clause of the specified kind.
      Specified by:
      containsClause in class TupleRuntimePlan
      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:
      isSparkJobNeeded in class TupleRuntimePlan
      Returns:
      true if the execution triggers a Spark, false otherwise, null if undetermined yet.