def deleteFile(filepath: String, uri: String = "hdfs://localhost:9000") {
val hadoopConf = new org.apache.hadoop.conf.Configuration()
val hdfs = org.apache.hadoop.fs.FileSystem.get(new java.net.URI(uri), hadoopConf)
try {
hdfs.delete(new org.apache.hadoop.fs.Path(filepath), true)
} catch {
case e : Throwable => e.printStackTrace
}
}
みたいな感じで、
- dateframeを使えば、overwrite optionでsaveできる