def rename(self): test_path = self.hdfs_paths[0] new_path = "%s.new" % test_path hdfs.dump(self.data, test_path, mode="wb") hdfs.rename(test_path, new_path) self.assertFalse(hdfs.path.exists(test_path)) self.assertTrue(hdfs.path.exists(new_path)) self.assertRaises(RuntimeError, hdfs.rename, test_path, self.local_paths[0])
def rename(self): test_path = self.hdfs_paths[0] new_path = "%s.new" % test_path hdfs.dump(self.data, test_path) hdfs.rename(test_path, new_path) self.assertFalse(hdfs.path.exists(test_path)) self.assertTrue(hdfs.path.exists(new_path)) self.assertRaises( RuntimeError, hdfs.rename, test_path, self.local_paths[0] )
def rename(src, dest): """ Rename src to dest. Args: :src: You can specify either a full hdfs pathname or a relative one (relative to your Project's path in HDFS). :dest: You can specify either a full hdfs pathname or a relative one (relative to your Project's path in HDFS). """ src = _expand_path(src, project_name()) dest = _expand_path(dest, project_name(), exists=False) return hdfs.rename(src, dest)
def rename(self, old, new): hdfs.rename(old,new)