def test_get_merge_command(self): with patch(HDFS_IS_DIR_FUNC) as mock_isdir: mock_isdir.return_value = True hdfs_client.get_merge( src="/user/test/data", local_dst="~/data.txt", executor=lambda cmd, *args: self._assert_command_generation( "hadoop fs -getmerge /user/test/data ~/data.txt") (cmd, *args))
def merge(self, dest_file): """ Merges the files at HDFS path to a single file on the local filesystem :param dest_file: path to destination file :type dest_file: str """ fs.get_merge(src=self.path, local_dst=dest_file).if_failed_raise( CommandException("Cannot merge files from '{path}' to {dst}".format(path=self.path, dst=dest_file)) )
def merge(self, dest_file): """ Merges the files at HDFS path to a single file on the local filesystem :param dest_file: path to destination file :type dest_file: str """ fs.get_merge(src=self.path, local_dst=dest_file).if_failed_raise( CommandException( "Cannot merge files from '{path}' to {dst}".format( path=self.path, dst=dest_file)))
def test_get_merge_command(self): with patch(HDFS_IS_DIR_FUNC) as mock_isdir: mock_isdir.return_value = True hdfs_client.get_merge( src="/user/test/data", local_dst="~/data.txt", executor=lambda cmd, *args: self._assert_command_generation( "hadoop fs -getmerge /user/test/data ~/data.txt" )(cmd, *args), )