无法将数据附加到镶木地板 [FileAlreadyExists 异常]

Unable to append data to parquet [FileAlreadyExists exception]

我正在尝试使用以下命令将数据框的数据附加到现有的 parquet 文件:

dfModified
  .write
  .mode("append")
  .parquet("/home/hduser/s_s_c/fadpd/fadpd.parquet")

但我一直收到这种异常:

Exception in thread "main" org.apache.hadoop.fs.FileAlreadyExistsException: Parent path is not a directory: file:/home/hduser/s_s_c/fadpd/fadpd.parquet

此外,我在 false 开头设置了 spark.speculation。 有谁知道我错在哪里?感谢您的帮助和时间!

对于所有尝试在 parquet 文件中追加数据的人。您不能 附加 parquet 文件。你需要重新创建一个,当你查询的时候,你需要查询所有的:)