Created 03-28-2016 03:50 PM
I want to run sqoop query to table count records and save this result into any file locally or in hdfs but I can not.
I run this query:-
sqoop eval --connect hostname/db --username user --password password --query 'select count(*) from tablename' --target-dir /sandbox/test
I am getting error:-
Running Sqoop version: 1.4.6.2.3.0.0-2557 (Sqoop:92) 2016-03-28 11:57:55,725 WARN - [main:] ~ Setting your password on the command-line is insecure. Consider using -P instead.
(BaseSqoopTool:1021) 2016-03-28 11:57:55,725 ERROR - [main:] ~ Error parsing arguments for eval: (BaseSqoopTool:303) 2016-03-28 11:57:55,725 ERROR - [main:] ~ Unrecognized argument: --target-dir (BaseSqoopTool:306) 2016-03-28 11:57:55,725 ERROR - [main:] ~ Unrecognized argument: /sandbox/test (BaseSqoopTool:306)
Created 03-28-2016 04:09 PM
Please try below command, its working fine on my cluster.
sqoop import --connect jdbc:mysql://hostname/classicmodels --username root --password xxx --query 'select count(*) as cnt from customers where $CONDITIONS' --m 1 --target-dir /tmp/count1 --driver com.mysql.jdbc.Driver
Created 03-28-2016 04:09 PM
Please try below command, its working fine on my cluster.
sqoop import --connect jdbc:mysql://hostname/classicmodels --username root --password xxx --query 'select count(*) as cnt from customers where $CONDITIONS' --m 1 --target-dir /tmp/count1 --driver com.mysql.jdbc.Driver
Created 03-28-2016 05:12 PM
Thank you so much ! It is working now
you are the man !
Created 03-28-2016 06:08 PM
Thanks Mike for confirming, would be great if you can click on best answer 🙂