0
votes

I am stuck with a situation where I need to run a sqoop import and put the MR job into a specific queue.

I tried the following command but it doesn't work.

/usr/bin/sqoop import -Dmapred.job.queue.name=scheduledjobs --username=hduser --password=XXXXXXX --connect jdbc:mysql://127.0.0.1/analytics --fields-terminated-by ',' --query "SELECT email FROM analytics.store WHERE \$CONDITIONS" -m1 --hive-import --hive-table "abce.ucsd" --hive-overwrite --target-dir /result/

Also this did not work

/usr/bin/sqoop import --Dmapred.job.queue.name=scheduledjobs --username=hduser --password=XXXXXXX --connect jdbc:mysql://127.0.0.1/analytics --fields-terminated-by ',' --query "SELECT email FROM analytics.store WHERE \$CONDITIONS" -m1 --hive-import --hive-table "abce.ucsd" --hive-overwrite --target-dir /result/

Please let me know what am i doing wrong.

1
Can you please share the trace log.Rajnish G
It happend to work now when I run from command line. Earlier I was trying to execute the same from a script. using --option-file ${source_directory} syntax and it always gave me errors or wrong syntax.Priyabrata Patnaik

1 Answers

2
votes

This is an old question, but maybe the answer will help somebody else. The sqoop import above has 1 extra - before the Dmapred.job.queue.name call.

You have

/usr/bin/sqoop import **--**Dmapred.job.queue.name=scheduledjobs --username=hduser

and it should be

/usr/bin/sqoop import **-**Dmapred.job.queue.name=scheduledjobs --username=hduser 

If you use the one with --, it will fail with an Error parsing arguments message.