Resolves an error when the--split-by parameter is a date type when Sqoop importing an Oracle table: Ora-01861:literal does not match format string

Source: Internet
Author: User
Tags auth sqoop

Error Stack:

 .- .- ,  -: $: -,422INFO [main] org.apache.sqoop.mapreduce.db.DBRecordReader:Executing query:Select "Jfrq","ZYH","Fyks","Ksse","Ybje","Ypje","Zjje"  fromBshis."Depcs_t_depcs_brmxcost_day"Tblwhere(Jfrq >='2009-01-01 00:00:00.0') and (Jfrq <'2009-10-13 04:00:00.0' ) .- .- ,  -: $: -,439ERROR [main] org.apache.sqoop.mapreduce.db.DBRecordReader:Top level Exception:java.sql.SQLDataException:ORA -01861: literal does not match formatstringAt oracle.jdbc.driver.T4CTTIoer.processError (T4cttioer.java:445) at Oracle.jdbc.driver.T4CTTIoer.processError (T4cttioer.java:396) at Oracle.jdbc.driver.T4C8Oall.processError (T4c8oall.java:879) at Oracle.jdbc.driver.T4CTTIfun.receive (T4cttifun.java: the) at Oracle.jdbc.driver.T4CTTIfun.doRPC (T4cttifun.java:192) at Oracle.jdbc.driver.T4C8Oall.doOALL (T4c8oall.java:531) at Oracle.jdbc.driver.T4CPreparedStatement.doOall8 (T4cpreparedstatement.java:207) at Oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe (T4cpreparedstatement.java:884) at Oracle.jdbc.driver.OracleStatement.executeMaybeDescribe (Oraclestatement.java:1167) at Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (Oraclestatement.java:1289) at Oracle.jdbc.driver.OraclePreparedStatement.executeInternal (Oraclepreparedstatement.java:3584) at Oracle.jdbc.driver.OraclePreparedStatement.executeQuery (Oraclepreparedstatement.java:3628) at Oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery (Oraclepreparedstatementwrapper.java: 1493) at Org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery (Dbrecordreader.java:111) at Org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue (Dbrecordreader.java:235) at Org.apache.hadoop.mapred.maptask$newtrackingrecordreader.nextkeyvalue (Maptask.java:556) at Org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue (Mapcontextimpl.java: the) at Org.apache.hadoop.mapreduce.lib.map.wrappedmapper$context.nextkeyvalue (Wrappedmapper.java: the) at Org.apache.hadoop.mapreduce.Mapper.run (Mapper.java:145) at Org.apache.sqoop.mapreduce.AutoProgressMapper.run (Autoprogressmapper.java: -) 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:164) at java.security.AccessController.doPrivileged (Native Method) at Javax.security.auth.Subject.doAs (Subject.jav A:422) at Org.apache.hadoop.security.UserGroupInformation.doAs (Usergroupinformation.java:1657) at Org.apache.hadoop.mapred.YarnChild.main (Yarnchild.java:158) .- .- ,  -: $: -,448INFO [thread- A] Org.apache.sqoop.mapreduce.autoprogressmapper:auto-progress Thread isFinished. keepgoing=false .- .- ,  -: $: -,468WARN [main] org.apache.hadoop.mapred.YarnChild:Exception running child:java.io.IOException:SQLExceptioninchNextkeyvalue 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: the) at Org.apache.hadoop.mapreduce.lib.map.wrappedmapper$context.nextkeyvalue (Wrappedmapper.java: the) at Org.apache.hadoop.mapreduce.Mapper.run (Mapper.java:145) at Org.apache.sqoop.mapreduce.AutoProgressMapper.run (Autoprogressmapper.java: -) 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:164) at java.security.AccessController.doPrivileged (Native Method) at Javax.security.auth.Subject.doAs (Subject.jav A:422) at Org.apache.hadoop.security.UserGroupInformation.doAs (Usergroupinformation.java:1657) at Org.apache.hadoop.mapred.YarnChild.main (Yarnchild.java:158) caused By:java.sql.SQLDataException:ORA-01861: literal does not match formatstringAt oracle.jdbc.driver.T4CTTIoer.processError (T4cttioer.java:445) at Oracle.jdbc.driver.T4CTTIoer.processError (T4cttioer.java:396) at Oracle.jdbc.driver.T4C8Oall.processError (T4c8oall.java:879) at Oracle.jdbc.driver.T4CTTIfun.receive (T4cttifun.java: the) at Oracle.jdbc.driver.T4CTTIfun.doRPC (T4cttifun.java:192) at Oracle.jdbc.driver.T4C8Oall.doOALL (T4c8oall.java:531) at Oracle.jdbc.driver.T4CPreparedStatement.doOall8 (T4cpreparedstatement.java:207) at Oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe (T4cpreparedstatement.java:884) at Oracle.jdbc.driver.OracleStatement.executeMaybeDescribe (Oraclestatement.java:1167) at Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (Oraclestatement.java:1289) at Oracle.jdbc.driver.OraclePreparedStatement.executeInternal (Oraclepreparedstatement.java:3584) at Oracle.jdbc.driver.OraclePreparedStatement.executeQuery (Oraclepreparedstatement.java:3628) at Oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery (Oraclepreparedstatementwrapper.java: 1493) at Org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery (Dbrecordreader.java:111) at Org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue (Dbrecordreader.java:235)    ...  AMore

The error is SQL throw, SQL rewrite after successful execution, the following two sentences can be:

SQOOP a bug:https://issues.apache.org/jira/browse/sqoop-1946, the solution is roughly converted to a string type. The type of this column is found to be date, so the solution is:--split-by "To_char (my Date column, ' Yyyy-mm-dd hh24:mi:ss ')".
Reference: https://my.oschina.net/pomo/blog/725060

Resolves an error when the--split-by parameter is a date type when Sqoop importing an Oracle table: Ora-01861:literal does not match format string

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.