def hdfs_folder_exists(self, folder): path = Path(folder) fs = path.getFileSystem(Configuration()) try: status = fs.getFileStatus(path) # TODO: there could be problems if it exists but is a simple file return status.isDir() except: return False
def copyContentFromLocalFile(self, content, dest_path, overwrite = True): file_path = Path(dest_path) fs = file_path.getFileSystem(self.configuration) if overwrite and fs.exists(file_path): fs.delete(file_path, True) self.createInputFile(fs, dest_path, content)
def copyContentFromLocalFile(self, content, dest_path, overwrite=True): file_path = Path(dest_path) fs = file_path.getFileSystem(self.configuration) if overwrite and fs.exists(file_path): fs.delete(file_path, True) self.createInputFile(fs, dest_path, content)