现在有这样一个需求。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 没有与它相关的字段对应起来