'Spark Scala: Extract values from a struct
I have different dataframes with different numbers of languages here is one example:
|-- Data: struct (nullable = true)
| |-- languages: struct (nullable = true)
| | |-- swe: string (nullable = true)
| | |-- fin: string (nullable = true)
| | |-- den: string (nullable = true)
is it possible to extract the languages swe, fin and den?
My plan is then using withColumn with coalesce with the extracted values.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
