現在有這樣一個需求。hive中ods層資料表結構與mysql源資料結構一致。然后在利用sqoop抽取資料時,只抽取我們的需要的欄位,利用--query ' ' 。 但是如何將抽取到的資料 與 hive表中的欄位對應起來呢?
這是我的抽取 腳本
sqoop import \
--connect jdbc:mysql://00.00.00.00:3306/rmpsdb_che \
--username xxxxxxxx_r --password xxxxxxx \
--query "select APP_NO,ID from tm_car_phone where \$CONDITIONS " \
--split-by ID \
--columns 'APP_NO,ID' \
--hive-import -m 5 \
--hive-table ods_rmpsdb_che_TM_CAR_PHONE \
--target-dir /data1/ODS/rmpsdb/che/TM_CAR_PHONE \
--fields-terminated-by '\t' \
--null-non-string '' \
--null-string ''
這是抽取結果 APP_NO 和 ID 沒有與它相關的欄位對應起來
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/103668.html
標籤:數據倉庫
上一篇:新人求助基礎的MySQL問題
