Package org.rumbledb.runtime.flwor.udfs
Class DataFrameContext
java.lang.Object
org.rumbledb.runtime.flwor.udfs.DataFrameContext
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionBuilds a new data frame context that only serves to pool Kryo objects.DataFrameContext(DynamicContext context, List<FlworDataFrameColumn> columns) Builds a new data frame context. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetFromRow(org.apache.spark.sql.Row row) Sets the context from a DataFrame row.voidsetFromRow(org.apache.spark.sql.Row row, ItemType itemType) Sets the context from a DataFrame row.
-
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
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
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.
-