Example #1
0
 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))
Example #2
0
File: hdfs.py Project: epam/Merlin
 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))
     )
Example #3
0
 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)))
Example #4
0
 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),
         )