Hi Binal,

I think whether or not there are any filters to be used in where clause for a 
query, I think you still need to specify 'where' clause.

Can you please try this

sqoop import --connect <connect-string> --username <user> --password <pwd> 
--target-dir <dir> --query "select * from <table name> where \$CONDITIONS limit 
5" --split-by CREATE_DATE




Regards
----------------
Vikash Talanki
Sent from iPhone-Excuse typos

On 02-Jul-2014, at 6:59, "James Birchfield" 
<[email protected]<mailto:[email protected]>> wrote:


Try putting conditions before the limit clause

Birch

On Jul 2, 2014 12:37 AM, "Vikash Talanki -X (vtalanki - INFOSYS LIMITED at 
Cisco)" <[email protected]<mailto:[email protected]>> wrote:
Hi Binal,

Can you please try this

sqoop import --connect <connect-string> --username <user> --password <pwd> 
--target-dir <dir> --query "select * from <table name> LIMIT 5 AND 
\\$CONDITIONS" --split-by CREATE_D

Thanks,
Vikash Talanki
+1 (408)838-4078<tel:%2B1%20%28408%29838-4078>

From: Binal Jhaveri [mailto:[email protected]<mailto:[email protected]>]
Sent: Tuesday, July 01, 2014 9:01 PM
To: [email protected]<mailto:[email protected]>
Subject: sqoop import with LIMIT clause in query

I am trying to run a query to get only 5 rows. I am using it for debugging 
purposes.
sqoop import --connect <connect-string> --username <user> --password <pwd> 
--target-dir <dir> --query "select * from <table name> LIMIT 5" --split-by 
CREATE_DATE
by running the above query, I get the below error:
Encountered IOException running import job: java.io.IOException: Query [select 
* from MSP.SPORT_ACTIVITY LIMIT 5] must contain '$CONDITIONS' in WHERE clause.
sqoop import --connect <connect-string> --username <user> --password <pwd> 
--target-dir <dir> --query "select * from <table name> LIMIT 5 AND 
\$CONDITIONS" --split-by CREATE_DATE
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:879)

Reply via email to