作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 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/
我正在尝试在 Azure HdInsigth 中执行此代码。我有一个与 Data Lake Storage 连接的 Spark 集群。 spark.conf.set( "fs.azure.sas.da
我是一名优秀的程序员,十分优秀!