pyspark.sql.tvf.TableValuedFunction#

class pyspark.sql.tvf.TableValuedFunction(sparkSession)[source]#

Interface for invoking table-valued functions in Spark SQL.

Methods

collations()

Get all of the Spark SQL string collations.

explode(collection)

Returns a DataFrame containing a new row for each element in the given array or map.

explode_outer(collection)

Returns a DataFrame containing 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 DataFrame containing a new row for each element with position in the given array or map.

posexplode_outer(collection)

Returns a DataFrame containing a new row for each element with position in the given array or map.

range(start[, end, step, numPartitions])

Create a DataFrame with single pyspark.sql.types.LongType column named id, containing elements in a range from start to end (exclusive) with step value step.

sql_keywords()

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.