参数说明:
--validate <class-name>启用数据副本验证功能,仅支持单表拷贝,可以指定验证使用的实现类
--validation-threshold <class-name>指定验证门限所使用的类
--direct 使用直接导出模式(优化速度)
--export-dir <dir>导出过程中HDFS源路径
-m,--num-mappers <n>使用n个map任务并行导出
--table <table-name>导出的目的表名称
--call <stored-proc-name>导出数据调用的指定存储过程名
--update-key <col-name>更新参考的列名称,多个列名使用逗号分隔
--update-mode <mode>指定更新策略,包括:updateonly(默认)、allowinsert
--input-null-string <null-string>使用指定字符串,替换字符串类型值为null的列
--input-null-non-string <null-string>使用指定字符串,替换非字符串类型值为null的列
--staging-table <staging-table-name>在数据导出到数据库之前,数据临时存放的表名称
--clear-staging-table清除工作区中临时存放的数据
--batch使用批量模式导出
mysql:
全量导出:
//例1
//先清空mysql这张表
#!/bin/bash
sqoop eval --connect "jdbc:mysql://172.***.***.170:3309/p_b?useUnicode=true&char