工作生活

Sqoop | 命令

2019-07-04  本文已影响0人  icebreakeros

sqoop命令

sqoop1命令

sqoop import \
    --connect "jdbc:mysql://192.168.219.51:3306/sqoop" \
    --username "sqoop" \
    --password "******" \
    --table "user" \
    --where "id<3" \
    --target-dir "/data/sqoop/user" \
    --fields-terminated-by "\t" \
    --delete-target-dir -m 2

sqoop import \
    --connect "jdbc:mysql://192.168.219.51:3306/sqoop" \
    --username "sqoop" \
    --password "******" \
    --query "select * from user where id<=3 and \$CONDITIONS" \
    --target-dir "/data/sqoop/user" \
    --fields-terminated-by "\t" \
    --delete-target-dir -m 1

sqoop import \
    --connect "jdbc:mysql://192.168.219.51:3306/sqoop" \
    --username "sqoop" \
    --password "******" \
    --table "user" \
    --where "id<3" \
    --hive-database hive \
    --hive-import \
    --hive-overwrite \
    --hive-table user \
    --fields-terminated-by "\t" \
    --delete-target-dir -m 2

sqoop export \
    --connect "jdbc:mysql://192.168.219.51:3306/sqoop" \
    --username "sqoop" \
    --password "******" \
    --table "user" \
    --export-dir "/data/sqoop/user" \
    --input-fields-terminated-by "\t" \
    --columns "id,name,age,birthday" -m 1

sqoop job --create <job-id>
sqoop job --delete <job-id>
sqoop job --exec <job-id>
sqoop job --show <job-id>
sqoop job --list
上一篇下一篇

猜你喜欢

热点阅读