0
我有一個Spark斯卡拉數據框與嵌套結構:重命名Scala中嵌套元素星火據幀
|-- _History: struct (nullable = true)
| |-- Article: array (nullable = true)
| | |-- element: struct (containsNull = true)
| | | |-- Id: string (nullable = true)
| | | |-- Timestamp: long (nullable = true)
| |-- Channel: struct (nullable = true)
| | |-- <font><font>Cultura pop</font></font>: array (nullable = true)
| | | |-- element: long (containsNull = true)
| | |-- <font><font>Deportes</font></font>: array (nullable = true)
| | | |-- element: long (containsNull = true)
我試圖重新命名嵌套元素(如<font><font>Deportes</font></font>
到Deportes
有沒有辦法做到這一點使用UDF或類似的東西
我試過以下,它不工作:?
var filterDF2 = filterDF
.withColumnRenamed("_History.Channel.<font><font>Deportes</font></font>", "_History.Channel.Deportes")