Home > database >  The problem of sqoop
The problem of sqoop

Time:10-02

Now there is a demand, in the hive ods layer data table structure and mysql source data structure, and then use sqoop extract data, only draw our need field, use -- query ', but how to extract the data with the actual hive fields in a table?

This is my draw script
Sqoop import \
- connect the JDBC: mysql://00.00.00.00:3306/rmpsdb_che \
- the username xxxxxxxx_r - password XXXXXXX \
- the query "select APP_NO, ID from tm_car_phone where \ $the CONDITIONS" \
- the split - by ID \
- the columns' APP_NO, ID \
- hive - import - m 5 \
- the 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 '

This is extracted APP_NO and match them with the ID no and its related fields

  • Related