sqoop导入导出命令

    xiaoxiao2022-07-04  113

    导入hive

    sqoop import --hive-import --connect jdbc:mysql://172.17.0.0:3306/test --username root --password root123 --table zz_test --hive-database test --hive-table zz_test --fields-terminated-by '\001' --hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' -m 1 --hive-overwrite

    从hive导出到mysql

    sqoop export --connect "jdbc:mysql://172.17.0.0:3306/test?useUnicode=true&characterEncoding=utf-8" --username root --password root --table zz_test --export-dir '/user/hive/warehouse/test.db/zz_test/*' --input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\001' -m 50

    导入hive指定字段

    sqoop import --hive-import --connect jdbc:mysql://172.17.0.0:3306/test --username root --password root --table zz_test --hive-database test --hive-table zz_test --fields-terminated-by '\001' --hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' -m 1 --hive-overwrite --columns 'id,pname'
    最新回复(0)