sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gwen Shapira <gshap...@cloudera.com>
Subject Re: sqoop import with LIMIT clause in query
Date Thu, 03 Jul 2014 01:23:55 GMT
Thank you for reporting back with the solution.

Sent from my iPad

On Jul 2, 2014, at 5:54 PM, Binal Jhaveri <binal165@gmail.com> wrote:

> My bad here. I was using the oracle DB and using LIMIT which oracle does not support.
Used Rownum instead.
> 
> This worked.
> 
> sqoop import --connect <connect-string> --username <user> --password <pwd>
--target-dir <dir> --query "select * from <table name> WHERE rownum <=5 AND
\$CONDITIONS" --split-by CREATE_D 
> 
> 
> On Wed, Jul 2, 2014 at 8:26 AM, Gwen Shapira <gshapira@cloudera.com> wrote:
>> Try:
>> 
>> sqoop import --connect <connect-string> --username <user> --password
<pwd> --target-dir <dir> --query "select * from <table name> WHERE \\$CONDITIONS
LIMIT 5 " --split-by CREATE_D 
>> 
>> 
>> 
>> On Wed, Jul 2, 2014 at 8:22 AM, Binal Jhaveri <binal165@gmail.com> wrote:
>>> 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 does not work. 
>>> 
>>> 
>>> On Tue, Jul 1, 2014 at 9:37 PM, Vikash Talanki -X (vtalanki - INFOSYS LIMITED
at Cisco) <vtalanki@cisco.com> 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
>>>> 
>>>>  
>>>> 
>>>> From: Binal Jhaveri [mailto:binal165@gmail.com] 
>>>> Sent: Tuesday, July 01, 2014 9:01 PM
>>>> To: user@sqoop.apache.org
>>>> 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)
>>>> 
> 

Mime
View raw message