Support Questions

Find answers, ask questions, and share your expertise

Sqoop: What happens if both the --query and --columns parameters are present in the Sqoop command? Will one override the other?

avatar
 
1 ACCEPTED SOLUTION

avatar

As with all "interesting" questions like this, the best answer is to try it and see for yourself. My hypothesis was that sqoop would report these directives are incompatible with each other and I was glad to see that was what happened when I gave it a try myself.

[root@sandbox Lab3.1]# sqoop import --connect jdbc:mysql://sandbox/test?user=root --table salaries --columns gender,age --query "select * from salaries s where s.salary > 90000.00 and \$CONDITIONS" --split-by gender -m 2 --target-dir willItWork
16/11/11 08:22:34 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.3.2.0-2950
Cannot specify --query and --table together.
Try --help for usage instructions.
[root@sandbox Lab3.1]#

View solution in original post

1 REPLY 1

avatar

As with all "interesting" questions like this, the best answer is to try it and see for yourself. My hypothesis was that sqoop would report these directives are incompatible with each other and I was glad to see that was what happened when I gave it a try myself.

[root@sandbox Lab3.1]# sqoop import --connect jdbc:mysql://sandbox/test?user=root --table salaries --columns gender,age --query "select * from salaries s where s.salary > 90000.00 and \$CONDITIONS" --split-by gender -m 2 --target-dir willItWork
16/11/11 08:22:34 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.3.2.0-2950
Cannot specify --query and --table together.
Try --help for usage instructions.
[root@sandbox Lab3.1]#