在将sqoop导入与多个映射器结合使用时创建单个文件

时间:2020-05-01 15:09:03

标签: sqoop

我想使用sqoop导入从Cobol-DB2导入数据,但我的要求是我要使用4个映射器,但它应该在hdfs目标目录中仅创建一个文件。有什么办法吗?

1 个答案:

答案 0 :(得分:0)

我认为Sqoop是不可能的,但是您可以随后使用HDFS命令合并目录,如下所示

-getmerge [-nl] <src> <localdst> :
  Get all the files in the directories that match the source file pattern and
  merge and sort them to only one file on local fs. <src> is kept.

作为示例

hdfs dfs -getmerge -nl /user/dir/cobol /user/dir/cobol_merged
相关问题