Class DataFrameContext

java.lang.Object
org.rumbledb.runtime.flwor.udfs.DataFrameContext
All Implemented Interfaces:
Serializable

public class DataFrameContext extends Object implements Serializable
This class exposes a reusable context that is dynamically populated from the input tuples stored in DataFrames. It also pools Kryo objects, inputs and outputs for better performance. This class is meant to be used by various FLWOR clauses to get a context in which to evaluate their expressions.
Author:
Ghislain Fourny
See Also:
  • Constructor Details

    • DataFrameContext

      public DataFrameContext()
      Builds a new data frame context that only serves to pool Kryo objects. The only allowed methods are getKryo, getInput and getOutput.
    • DataFrameContext

      public DataFrameContext(DynamicContext context, List<FlworDataFrameColumn> columns)
      Builds a new data frame context.
      Parameters:
      context - the parent dynamic context, which contains all variable values except those in input tuples.
      columns - the DataFrame columns applicable to the calling clause.
  • Method Details

    • setFromRow

      public void setFromRow(org.apache.spark.sql.Row row)
      Sets the context from a DataFrame row.
      Parameters:
      row - An row, the column names and types of which must correspond to those passed in the constructor.
    • setFromRow

      public void setFromRow(org.apache.spark.sql.Row row, ItemType itemType)
      Sets the context from a DataFrame row.
      Parameters:
      row - An row, the column names and types of which must correspond to those passed in the constructor.
      itemType - the itemType to use for the conversion.