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 single- pyspark.sql.types.LongTypecolumn named- id, containing elements in a range from- startto- end(exclusive) with step value- step.- 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.