You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Sadasiva R Guntupalli <sr...@beckman.com> on 2012/09/11 00:04:16 UTC

sqoop import from oracle database fails when using split-by timestamp column

Hi,

I am running the following sqoop command to import data from Oracle 11g to 
Hive database. It throws the following exception. I appreciate your help.

Sqoop Command:

 sqoop import --connect jdbc:oracle:thin:@//abc-scan:1521/RACMSLT --query 
'SELECT R.MESSAGE_ID, R.EVENT_DATETIME FROM EVENT_CONTENT
  PARTITION(CONTENT_P20120826) R WHERE $CONDITIONS'   --split-by 
EVENT_DATETIME  --username ABC --password RMLT01 --target-dir 
/user/hive/SS/CONTENT --hive-table EVENT_CONTENT 
  --hive-import  --hive-partition-key  HYDRO_PART_DATE 
--hive-partition-value "2012-08-26" -m 6 --verbose

Oracle database table:

EVENT_CONTENT
-------------
  MESSAGE_ID                    NUMBER 
  EVENT_DATETIME        TIMESTAMP(3)


Exception:

java.io.IOException: SQLException in nextKeyValue
        at 
org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:265)
        at 
org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:474)
        at 
org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
        at 
org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:183)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:668)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:334)
        at org.apache.hadoop.mapred.Child$4.run(Child.java:270)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1126)
        at org.apache.hadoop.mapred.Child.main(Child.java:264)
Caused by: java.sql.SQLDataException: ORA-01843: not a valid month

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:400)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:926)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:200)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:543)
        at 
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:238)
        at 
oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:1244)
        at 
oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1492)
        at 
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1710)
        at 
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4372)
        at 
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:4453)
        at 
oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:6270)
        at 
org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)
        at 
org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:236)
        ... 11 more


Thanks
Sadasiva

The server  made the following annotations                           

---------------------------------------------------------------------------------

This message contains information that may be privileged or confidential and is the property of Beckman Coulter, Inc.  It is intended only for the person to whom it is addressed.  If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute or use this message or any part thereof.  If you receive this message in error, please notify the sender immediately and delete all copies of this message.

---------------------------------------------------------------------------------