Error ORA-01843 when importing table in Sqoop

0

I'm facing an error from which I can not understand the source.

Previously I had imported a table with the same data format, with 54 million lines to the HDFS of my Hadoop cluster .

Now I created a _View_ in my database Oracle and selected a portion of the table data. Now it has only 260k lines, however I now face this error quoted even using a similar command.

SQOOP

The error generated this here:

  

Error: java.io.IOException: SQLException in nextKeyValue at   org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue (DBRecordReader.java:277)     at   org.apache.hadoop.mapred.MapTask $ NewTrackingRecordReader.nextKeyValue (MapTask.java:556)     at   org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue (MapContextImpl.java:80)     at   org.apache.hadoop.mapreduce.lib.map.WrappedMapper $ Context.nextKeyValue (WrappedMapper.java:91)     at org.apache.hadoop.mapreduce.Mapper.run (Mapper.java:145) at   org.apache.sqoop.mapreduce.AutoProgressMapper.run (AutoProgressMapper.java:64)     at org.apache.hadoop.mapred.MapTask.runNewMapper (MapTask.java:787)
    at org.apache.hadoop.mapred.MapTask.run (MapTask.java:341) at   org.apache.hadoop.mapred.YarnChild $ 2.run (YarnChild.java:168) at   java.security.AccessController.doPrivileged (Native Method) at   javax.security.auth.Subject.doAs (Subject.java:422) at   org.apache.hadoop.security.UserGroupInformation.doAs (UserGroupInformation.java:1709)     at org.apache.hadoop.mapred.YarnChild.main (YarnChild.java:162)
  Caused by: java.sql.SQLDataException: ORA-01843: not a valid month

Previously I was able to export, also with data coming from a View , only with the complete table.

The command used was:
sqoop import --connect jdbc:oracle:thin:<meu_host:porta:instancia> --username <user> --password <pass> --table <DB.TABLE> --split-by NUM_LINHA --m 10 --target-dir /user/rodrigo/RESUMO_TABELONA 2>&1|tee import_tab_menor.txt

    
asked by anonymous 16.05.2017 / 22:23

1 answer

1

The error occurred because of how I created the View , using a literal to select a date range:

  

DT_F>'02/04/16

The error no longer occurs when I used it:

  

to_date('02/04/16' , 'dd/mm/yy)

    
19.05.2017 / 20:23