Created 05-06-2016 06:40 AM
How to fix this error?
va.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:1657) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162) Caused by: java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) at com.mysql.jdbc.ResultSetRow.getDateFast(ResultSetRow.java:145) at com.mysql.jdbc.ByteArrayRow.getDateFast(ByteArrayRow.java:243) at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:2015) at com.mysql.jdbc.ResultSetImpl.getDate(ResultSetImpl.java:1978) at org.apache.sqoop.lib.JdbcWritableBridge.readDate(JdbcWritableBridge.java:115) at com.cloudera.sqoop.lib.JdbcWritableBridge.readDate(JdbcWritableBridge.java:87) at additional_input_invoice.readFields(additional_input_invoice.java:325) at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:244) ... 12 more
Created 05-06-2016 06:44 AM
@simran kaur - can you please try below jdbc url
jdbc:mysql://yourserver:3306/yourdatabase?zeroDateTimeBehavior=convertToNull
Created 05-06-2016 06:44 AM
@simran kaur - can you please try below jdbc url
jdbc:mysql://yourserver:3306/yourdatabase?zeroDateTimeBehavior=convertToNull
Created 05-06-2016 07:16 AM
Awesome 🙂 worked like a charm. Thanks
Created 12-14-2016 04:55 AM
@Kuldeep Kulkarni what about if the same error happen for Oracle?
Created 12-14-2016 06:02 AM
Can you please post a separate question along with detailed stack trace?
Created 02-12-2018 03:14 PM
Can you please let me know where to try this?
Created 05-06-2016 06:44 AM
Append this to your jdbc connection string "?zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=UTF-8&characterSetResults=UTF-8"
in MySQL '0000-00-00' represent a valid date but it can not represented in java.sql.Date
Created 06-23-2016 10:37 AM
I'm not sure if you are using 'split-by' option.
In my case, this error happened because I was using 'split-by' column with a date column for distributing the process into nodes in the cluster, when I retrieve data using a query.
That was corrected when I use an integer column instead of using a date column
It seems that using date or string column is not working properly with sqoop when you use a query.