pyspark.sql.functions.inline¶
-
pyspark.sql.functions.
inline
(col: ColumnOrName) → pyspark.sql.column.Column[source]¶ Explodes an array of structs into a table.
New in version 3.4.0.
- Parameters
- col
Column
or str input column of values to explode.
- col
- Returns
Column
generator expression with the inline exploded result.
See also
Notes
Supports Spark Connect.
Examples
>>> from pyspark.sql import Row >>> df = spark.createDataFrame([Row(structlist=[Row(a=1, b=2), Row(a=3, b=4)])]) >>> df.select(inline(df.structlist)).show() +---+---+ | a| b| +---+---+ | 1| 2| | 3| 4| +---+---+