Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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 🙂