I have a dataframe that looks like this
| Column |
|------------------------------------------------|
|[{a: 2, b: 4}, {a: 2, b: 3}] |
|------------------------------------------------|
|[{a: 12, b: 14}, {a: 25, b: 33}, {a: 22, b: 31}]|
...
And I need to convert it to dataframe like
| a | b |
|---|---|
| 2 | 4 |
| 2 | 3 |
|12 |13 |
Simplest approach might be to use SparkSQL function
inline
as shown below:Note that while
inline
has been part of the SparkSQL API since2.0
, it's available as a built-in function for Dataframes only onSpark 3.4+
. To use it on older Spark versions, wrap it withexpr
like below: