sqoop引數詳解

2021-10-06 08:37:59 字數 2134 閱讀 8683

sqoop引數含義:

import和export引數解釋

common arguments:

--connect :連線rdbms的jdbc連線字串,例如:–connect jdbc:mysql:// mysql_server:port/dbname。

--connection-manager :

--hadoop-home :

--username :連線rdbms所使用的使用者名稱。

--password :連線rdbms所使用的密碼,明文。

--password-file :使用檔案儲存密碼。

-p :互動式連線rdbms的密碼。

import control arguments:

--as-sequencefile :import序列化的檔案。

--columns :指定列import,逗號分隔,比如:–columns 「id,name」。

--delete-target-dir :刪除存在的import目標目錄。

--direct :直連模式,速度更快(hbase不支援)

--inline-lob-limit < n > :設定內聯的blob物件的大小。

--fetch-size :一次從資料庫讀取n個例項,即n條資料。

-e,--query :構建表示式執行。

--target-dir :指定hdfs目標儲存目錄。

--warehouse-dir :可以指定為-warehouse-dir/user/hive/warehouse/即匯入資料的存放路徑,如果該路徑不存在,會首先建立。

--table :將要匯入到hive的表。

--where :指定where從句,如果有雙引號,注意轉義 \$conditions,不能用or,子查詢,join。

-z,--compress :開啟壓縮。

--null-string :string列為空指定為此值。

--null-non-string :非string列為空指定為此值,-null這兩個引數are optional, 如果不設定,會指定為」null」。

incremental import arguments:

--check-column :source column to check for incremental change

--last-value :last imported value in the incremental check column

hive arguments:

--create-hive-table :自動推斷表字段型別直接建表,hive-overwrite功能可以替代掉了,但hive裡此表不能存在,不然操作會報錯。

--hive-database :指定要把hdfs資料匯入到哪個hive庫。

--hive-table :設定到hive當中的表名。

--hive-delims-replacement :匯入到hive時用自定義的字元替換掉\n, \r, and \01。

--hive-drop-import-delims :匯入到hive時刪除欄位中\n, \r,\t and \01等符號;避免欄位中有空格導致匯入資料被截斷。

--hive-home :指定hive的儲存目錄。

--hive-import :將hdfs資料匯入到hive中,會自動建立hive表,使用hive的預設分隔符。

--hive-overwrite :對hive表進行覆蓋操作(需配合--hive-import使用,如果hive裡沒有表會先建立之),不然就是追加資料。

--hive-partition-key :hive分割槽的key。

--hive-partition-value :hive分割槽的值。

--map-column-hive :型別匹配,sql型別對應到hive型別。

hbase arguments:

--column-family < family > :把內容匯入到hbase當中,預設是用主鍵作為split列。

--hbase-create-table :建立hbase表。

--hbase-row-key < col > :指定字段作為row key ,如果輸入表包含復合主鍵,用逗號分隔。

--hbase-table < table-name > :指定hbase表。

大資料技術sqoop外掛程式使用引數詳解

1 常用命令 import 將資料匯入到集群 bin sqoop import connect jdbc mysql hadoop102 3306 school username root password 123456 table student target dir user sqoop del...

sqoop使用詳解

sqoop用於關聯式資料庫和hadoop家族 hdfs hive hbase 之間的etl 資料庫匯出到hadoop家族 sqoop import hadoop家族匯出到資料庫 sqoop export 官方 tar zxvf sqoop 1.4.7.binhadoop 2.6.0.tar.gz m...

黑猴子的家 Sqoop 命令與引數詳解

1 sqoop 公用引數 資料庫連線 2 sqoop 公用引數 import 3 sqoop 公用引數 export 4 sqoop 公用引數 hive 5 sqoop 命令 引數 import 6 sqoop 命令 引數 export 7 sqoop 命令 引數 codegen 8 sqoop 命...