我能够使用sqoop使用类似下面的命令导入MySQL表“标题”到HDFS:sqoop导入到hdfs和配置单元有什么区别?
sqoop import --connect jdbc:mysql://localhost/employees --username=root -P --table=titles --target-dir=titles --m=1
现在我要导入到蜂巢,如果我用下面的命令:
sqoop import --connect jdbc:mysql://localhost/employees --username=root -P --table titles --hive-import
我将提示:
输出目录HDFS://本地主机:9000 /用户/根/标题已经存在
在蜂巢,如果我做一个节目表,我得到如下:
hive> show tables;
OK
dept_emp
emp
myfirsthivetable
parted1emp
partitionedemp
你可以看到有在蜂巢
没有表名为标题,我在这迷茫,对进口的sqoop数据,hdfs和配置单元之间是否存在1:1的关系?提示的含义是什么?
谢谢你的启发。
谢谢Jaime您的详细解释。大家的帮助在这里非常感谢。 – PasLeChoix
只需再次尝试通过指示target-dir = titles_new并将数据加载到配置单元中,当列出配置单元时,我可以看到新添加的表;但是,如果我以不同的方式列出它:'[root @ xie1 Desktop]#hdfs dfs -ls hdfs:// localhost:9000/user/root',它不在那里。我也试过:'hdfs dfs -ls hdfs:// localhost:9000/user/titles_new',并提示没有这样的文件或目录。 – PasLeChoix
对不起,我想我犯了一个错字。 '--target-dir'参数应该具有目录的整个路径。在这种情况下,'--target-dir =/user/root/titles'。你可以检查导入的表是否在'/ titles'中? –