Created
September 10, 2018 14:04
-
-
Save YordanGeorgiev/8143e3b2b496f71960423ac517cd6245 to your computer and use it in GitHub Desktop.
[delete file if exists in spark] how-to delete a file if it exists in hdfs spark scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val fs = org.apache.hadoop.fs.FileSystem.get(spark.sparkContext.hadoopConfiguration) | |
if (fs.exists(new org.apache.hadoop.fs.Path(cleanedAdpFileUri))) | |
fs.delete(new Path(cleanedAdpFileUri), true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment