使用sgoop把部分数据导入到HDFS的/MysqlToHDFS3目录下,要求使用自定义SQL语句查询要导入的数据,如导入的字段为 id,name,age,查询条件为age>16,要求以id字段进行分片,使用两个mapper任务并发执行,则语句写法正确的是? bin/sgoop import--connect idbc:mysql://192.168.10.10:3306/userdb\ --username root --delete-target-dir --target-dir/MysqlToHDFS3\ OA -split-by id --fields-terminated-by't’ -query 'select id,name,age from student WHERE age > 16'\ -num-mappers2 bin/sgoop import--connect idbc:mysql://192.168.10.10:3306/userdb\ -username root-delete-target-dir-target-dir MysalToHDFS3\ B --query "select id.name.aae from student WHERE age > 16 and $CONDITIONS" -split-by id --fields-terminated-by't’ --num-mappers 2 bin/sgoop import--connect jdbc:mysql://192.168.10.10:3306/userdb\ --username root-delete-target-dir-target-dir MysqlToHDFS3\ OC --sp it-by id --fie ds-terminated-by"t --query "select id,name,age from student WHERE age > 16 and $CONDITIONS" -m 2 bin/sgoop import--connect idbc:mysgl://192.168.10.10:3306/userdb\ --username root-delete-target-dir-target-dir/MysalToHDFS3\ OD -query 'select id,name age from student WHERE age > 16 and $CONDITIONS'\ --split-by id --fields-terminated-by'\t’\ -m 2
时间: 2024-04-04 17:30:09 浏览: 133
正确的语句写法是:bin/sgoop import --connect jdbc:mysql://192.168.10.10:3306/userdb --username root --delete-target-dir --target-dir /MysqlToHDFS3 -split-by id --fields-terminated-by '\t' --query "select id,name,age from student WHERE age > 16 AND \$CONDITIONS" --num-mappers 2。
阅读全文