我能夠使用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'中? –