** 生成與關(guān)系數(shù)據(jù)庫表結(jié)構(gòu)對(duì)應(yīng)的hive表結(jié)構(gòu)。**
1、命令案列
[victor@node1 sqoop-1.4.7]$ bin/sqoop create-hive-table \
--connect jdbc:mysql://node1:3306/company \
--username root \
--password 000000 \
--table staff \
--hive-table hive_staff
尖叫提示:sqoop從mysql導(dǎo)入數(shù)據(jù)到Hive,但在hive卻找不到table,這是1.1.*的一個(gè)bug,重新安裝1.2.2,
并復(fù)制hive-site.xml到sqoop/conf目錄下
2、參數(shù)
| 序號(hào) | 參數(shù) | 說明 |
|---|---|---|
| 1 | --hive-home <dir> | Hive的安裝目錄,可以通過該參數(shù)覆蓋掉默認(rèn)的Hive目錄 |
| 2 | --hive-overwrite | 覆蓋掉在Hive表中已經(jīng)存在的數(shù)據(jù) |
| 3 | --create-hive-table | 默認(rèn)是false,如果目標(biāo)表已經(jīng)存在了,那么創(chuàng)建任務(wù)會(huì)失敗 |
| 4 | --hive-table | 后面接要?jiǎng)?chuàng)建的hive表 |
| 5 | --table | 指定關(guān)系數(shù)據(jù)庫的表名 |