gpt4 book ai didi

scala - 错误 AzureNativeFileSystemStore : DirectoryIsNotEmpty

转载 作者:行者123 更新时间:2023-12-02 19:54:13 26 4
gpt4 key购买 nike

我正在尝试在 Azure HdInsigth 中执行此代码。我有一个与 Data Lake Storage 连接的 Spark 集群。

spark.conf.set(
"fs.azure.sas.data.spmdevsharedstorage.blob.core.windows.net",
"xxxxxxxxxxx key xxxxxxxxxxx"
)


val shared_data = "wasbs://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f195908590b182819c95948782999083949582859e83909694df939d9e93df929e8394df86989f959e8682df9f9485" rel="noreferrer noopener nofollow">[email protected]</a>/"

//Read Csv
val dfCsv = spark.read.option("inferSchema", "true").option("header", true).csv(shared_data + "/test/4G-pixel.csv")
val dfCsv_final_withcolumn = dfCsv.select($"latitude",$"longitude")
val dfCsv_final = dfCsv_final_withcolumn.withColumn("new_latitude",col("latitude")*100)

//write
dfCsv_final.coalesce(1).write.format("com.databricks.spark.csv").option("header", "true").mode("overwrite").save(shared_data + "/test/4G-pixel_edit.csv")

该代码可以很好地读取 csv 文件。因此,当写入新文件 csv 时,我看到以下错误:

20/04/03 14:58:12 ERROR AzureNativeFileSystemStore: Encountered Storage Exception for delete on Blob: https://spmdevsharedstorage.blob.core.windows.net/data/test/4G-pixel_edit.csv/_temporary/0, Exception Details: This operation is not permitted on a non-empty directory. Error Code: DirectoryIsNotEmpty
org.apache.hadoop.fs.azure.AzureException: com.microsoft.azure.storage.StorageException: This operation is not permitted on a non-empty directory.
at org.apache.hadoop.fs.azure.AzureNativeFileSystemStore.delete(AzureNativeFileSystemStore.java:2627)
at org.apache.hadoop.fs.azure.AzureNativeFileSystemStore.delete(AzureNativeFileSystemStore.java:2637)

新文件 csv 已写入数据湖,但代码停止。我需要你不要看到这个错误。我该如何修复它?

最佳答案

我也遇到过类似的问题。

我通过使用以下配置解决了这个问题。将其设置为 true。

--conf spark.hadoop.mapreduce.fileoutputcommitter.cleanup.skipped=true

spark.conf.set("spark.hadoop.mapreduce.fileoutputcommitter.cleanup.skipped","true")

关于scala - 错误 AzureNativeFileSystemStore : DirectoryIsNotEmpty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60531211/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com