我在数据框中有一个列叫做“INFO_CSQ”。我想删除struct中的任何重复元素,这些元素使我无法使用命令df.select("INFO_CSQ.xxx")
,因为引用不明确
如果你想要更多的信息,请随时问我。我会尽快回答
编辑我看到许多解决方案都在使用重命名,我看到的所有解决方案都是手动键入strSchema = "array<struct<a_renamed:string,b:bigint,c:bigint>>"
并强制转换到新的数据帧,但是我的模式可以根据输入文件进行更改。
Tags:
您可以将数据帧转换为RDD,然后再转换回数据帧。重新创建dataframe时,可以提供列名唯一的架构
我使用了一个简化示例,其中fieldname
field2
不是唯一的:现在,您可以删除或忽略重命名的字段
field21
相关问题 更多 >
编程相关推荐