Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Sqoop, mail # user - Importing from OracleDB


+
James Hogarth 2013-02-01, 13:37
+
Jarek Jarcec Cecho 2013-02-01, 17:26
Copy link to this message
-
Re: Importing from OracleDB
James Hogarth 2013-02-01, 18:14
On 1 Feb 2013 17:27, "Jarek Jarcec Cecho" <[EMAIL PROTECTED]> wrote:
>
> Hi James,
> I'm afraid that using synonyms is not supported by Oracle driver. The
problem is that Oracle driver is issuing following query to get columns for
imported table:
>
>   SELECT COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE OWNER = ? AND TABLE_NAME
= ? ORDER BY COLUMN_ID
>
> This query returns no rows for synonym and thus import fails.
>
> As a workaround I would recommend to try out Generic JDBC Connector that
is not using this query to fetch table metadata. You can force Sqoop to use
Generic JDBC Connector by passing "--driver" parameter with value
oracle.jdbc.OracleDriver, e.g.
>
>   sqoop import --connect ... --driver oracle.jdbc.OracleDriver
>
> Another solution that might possibly help you is to install OraOop
connector, but I'm not sure whether it supports synonyms or not.
>
> Jarcec
>

Hi Jarcec

Thanks for confirming that.

In the end my workaround with specifying the columns capitalised ended up
working nicely and isn't so bad seeing as I needed to cast the oracle type
'number' to Long/BIGINT on a couple of the columns anyway...

Cheers

James
+
Jarek Jarcec Cecho 2013-02-01, 18:52