pyspark.sql.tvf.TableValuedFunction#
- class pyspark.sql.tvf.TableValuedFunction(sparkSession)[source]#
Interface for invoking table-valued functions in Spark SQL.
Methods
Get all of the Spark SQL string collations.
explode(collection)Returns a
DataFramecontaining a new row for each element in the given array or map.explode_outer(collection)Returns a
DataFramecontaining a new row for each element with position in the given array or map.inline(input)Explodes an array of structs into a table.
inline_outer(input)Explodes an array of structs into a table.
json_tuple(input, *fields)Creates a new row for a json column according to the given field names.
posexplode(collection)Returns a
DataFramecontaining a new row for each element with position in the given array or map.posexplode_outer(collection)Returns a
DataFramecontaining a new row for each element with position in the given array or map.range(start[, end, step, numPartitions])Create a
DataFramewith singlepyspark.sql.types.LongTypecolumn namedid, containing elements in a range fromstarttoend(exclusive) with step valuestep.Get Spark SQL keywords.
stack(n, *fields)Separates col1, ..., colk into n rows.
variant_explode(input)Separates a variant object/array into multiple rows containing its fields/elements.
variant_explode_outer(input)Separates a variant object/array into multiple rows containing its fields/elements.