首页 > 解决方案 > 如何通过 spark 读取带有重复列的 json?

问题描述

我正在通过 spark 阅读 json,没有什么特别的:

spark.read.option('compression', 'gzip').option('dropFieldIfAllNull', True)\
.json(source_final)

但它失败了: Found duplicate column(s) in the data schema。500 Mb 文件中没有连接,只有 2 个 JSON 行有重复的字段,整个 spark 作业失败。任何解决方法?

标签: jsonscalaapache-spark

解决方案


推荐阅读