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")