You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by foo bar <cl...@gmail.com> on 2014/09/30 19:55:40 UTC

No rows returned

Hi, I'm trying to import a dummy table (cities) into HDFS with the
following command:

$ sqoop import --connect jdbc:oracle:thin:@10.0.2.15:1521/XE --username
system --password root --table cities --columns country,city --split-by id
--target-dir /sqoop/output1

but no rows get imported.

The SQL statement that gets generated by Sqoop is

SELECT t.* FROM cities t WHERE 1=0

which is odd because 1 will never be equal to zero.

I'm running:
Hadoop 2.4.1
Sqoop 1.4.5

Any help is greatly appreciated.

Re: No rows returned

Posted by foo bar <cl...@gmail.com>.
Thank you Gwen,

As you described, the user didn't have access to the table.


On Tue, Sep 30, 2014 at 4:25 PM, Gwen Shapira <gs...@cloudera.com> wrote:

> The statement with "where 1=0" is generated just to get list of
> columns. We run the actual select in the MR job later on.
> (You can check in your job tracker or YARN logs).
>
> I suspect that "cities" table doesn't belong to SYSTEM user. Either
> log in as the user that owns cities or use --schema flag to specify
> the schema.
>
> Gwen
>
> On Tue, Sep 30, 2014 at 10:55 AM, foo bar <cl...@gmail.com> wrote:
> > Hi, I'm trying to import a dummy table (cities) into HDFS with the
> > following command:
> >
> > $ sqoop import --connect jdbc:oracle:thin:@10.0.2.15:1521/XE --username
> > system --password root --table cities --columns country,city --split-by
> id
> > --target-dir /sqoop/output1
> >
> > but no rows get imported.
> >
> > The SQL statement that gets generated by Sqoop is
> >
> > SELECT t.* FROM cities t WHERE 1=0
> >
> > which is odd because 1 will never be equal to zero.
> >
> > I'm running:
> > Hadoop 2.4.1
> > Sqoop 1.4.5
> >
> > Any help is greatly appreciated.
>

Re: No rows returned

Posted by Gwen Shapira <gs...@cloudera.com>.
The statement with "where 1=0" is generated just to get list of
columns. We run the actual select in the MR job later on.
(You can check in your job tracker or YARN logs).

I suspect that "cities" table doesn't belong to SYSTEM user. Either
log in as the user that owns cities or use --schema flag to specify
the schema.

Gwen

On Tue, Sep 30, 2014 at 10:55 AM, foo bar <cl...@gmail.com> wrote:
> Hi, I'm trying to import a dummy table (cities) into HDFS with the
> following command:
>
> $ sqoop import --connect jdbc:oracle:thin:@10.0.2.15:1521/XE --username
> system --password root --table cities --columns country,city --split-by id
> --target-dir /sqoop/output1
>
> but no rows get imported.
>
> The SQL statement that gets generated by Sqoop is
>
> SELECT t.* FROM cities t WHERE 1=0
>
> which is odd because 1 will never be equal to zero.
>
> I'm running:
> Hadoop 2.4.1
> Sqoop 1.4.5
>
> Any help is greatly appreciated.