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

Switch to Plain View
Sqoop, mail # user - Oracle Synonym import error


+
Vikash Talanki -X 2013-08-16, 18:44
+
Jarek Jarcec Cecho 2013-08-24, 23:09
+
Vikash Talanki -X 2013-08-25, 07:06
+
Jarek Jarcec Cecho 2013-08-25, 16:12
+
Vikash Talanki -X 2013-08-25, 16:29
Copy link to this message
-
Re: Oracle Synonym import error
Jarek Jarcec Cecho 2013-08-25, 17:00
Hi Vikash,
I've actually tried the scenario and it seems that current versions of the Generic JDBC Connector do not supports Oracle database. The problem is that generated query for fetching the metadata is something like the following:

  SELECT t.* FROM table AS t WHERE 1=0

However at least the version of oracle that I'm running is not supporting the keyword "AS" and requires to execute the query following way:

  SELECT t.* FROM table t WHERE 1=0

Jarcec

On Sun, Aug 25, 2013 at 04:29:20PM +0000, Vikash Talanki -X (vtalanki - Infosys Limited at Cisco) wrote:
> I shall try that definitely. But is it something like 1.4.1 doesn't support importing synonyms?
>
> Sent from my iPhone
> Excuse typos
>
> On 25-Aug-2013, at 9:13, "Jarek Jarcec Cecho" <[EMAIL PROTECTED]> wrote:
>
> > Hi Vikash,
> > would you mind trying to upgrade to the latest 1.4.4 and trying it there?
> >
> > Jarcec
> >
> > On Sun, Aug 25, 2013 at 07:06:44AM +0000, Vikash Talanki -X (vtalanki - Infosys Limited at Cisco) wrote:
> >> Hi Jarcec,
> >>
> >> I am using sqoop 1.4.1
> >>
> >> Regards
> >> -----------------------
> >> Vikash T
> >> +1 (408)506 2024
> >>
> >> -----Original Message-----
> >> From: Jarek Jarcec Cecho [mailto:[EMAIL PROTECTED]]
> >> Sent: Saturday, August 24, 2013 4:09 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: Re: Oracle Synonym import error
> >>
> >> Hi Vikash,
> >> what Sqoop version are you using?
> >>
> >> Jarcec
> >>
> >> On Fri, Aug 16, 2013 at 06:44:32PM +0000, Vikash Talanki -X (vtalanki - Infosys Limited at Cisco) wrote:
> >>> Hi ,
> >>>
> >>> I am trying to import a synonym from oracle. I have gone through the latest PDF available on sqoop and trying to import  synonym by below query :
> >>>
> >>> sqoop import \
> >>> --connect jdbc:oracle:thin:@173.36.136.11:1521/afprod.cisco.com \
> >>> --username NAI_DATA \ --password nai_data \ -m 1 \ --table
> >>> NITA_CNTRCT_MON_PRICE \ --hive-import --hive-table
> >>> nita_rcc.nita_cntrct_mon_price_synonym_test \ --driver
> >>> oracle.jdbc.OracleDriver \ --connection-manager
> >>> org.apache.sqoop.manager.GenericJdbcManager
> >>>
> >>> But when I do this I am getting the below exception :
> >>>
> >>> [dev@TSPM-SJ-ED1 ~]$ sqoop import --connect
> >>> jdbc:oracle:thin:@173.36.136.11:1521/afprod.cisco.com --username
> >>> NAI_DATA --password nai_data -m 1 --table NITA_CNTRCT_MON_PRICE
> >>> --hive-import --hive-table nita_rcc.nita_cntrct_mon_price_synonym_test
> >>> --driver oracle.jdbc.OracleDriver --connection-manager
> >>> org.apache.sqoop.manager.GenericJdbcManager
> >>> 13/08/16 11:18:21 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
> >>> 13/08/16 11:18:21 INFO tool.BaseSqoopTool: Using Hive-specific
> >>> delimiters for output. You can override
> >>> 13/08/16 11:18:21 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc.
> >>> 13/08/16 11:18:21 INFO manager.SqlManager: Using default fetchSize of
> >>> 1000
> >>> 13/08/16 11:18:21 INFO tool.CodeGenTool: Beginning code generation
> >>> 13/08/16 11:18:22 INFO manager.SqlManager: Executing SQL statement:
> >>> SELECT t.* FROM NITA_CNTRCT_MON_PRICE AS t WHERE 1=0
> >>> 13/08/16 11:18:22 ERROR manager.SqlManager: Error executing statement:
> >>> java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly
> >>> ended
> >>>
> >>> java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly
> >>> ended
> >>>
> >>>        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
> >>>        at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
> >>>        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
> >>>        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
> >>>        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
> >>>        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
> >>>        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)