In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "Sqoop in the import of MySQL data encountered Timestamp empty time error how to do", the article explained the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "Sqoop in the import of MySQL data encountered Timestamp as an empty error report how to do" it!
Sqoop reports an error when it encounters an empty Timestamp column while importing MySQL data The solution is to add zeroDateTimeBehavior=convertToNullError: 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: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:1073) at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:987) at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:982) at com.mysql.jdbc.SQLError.createSQLException (SQLError.java:927) at com.mysql.jdbc.ResultSetRow.getDateFast (ResultSetRow.java:141) at com.mysql.jdbc.ByteArrayRow.getDateFast (ByteArrayRow.java:238) at com .mysql.jdbc.ResultSetImpl.getDate (ResultSetImpl.java:2185) at com.mysql.jdbc.ResultSetImpl.getDate (ResultSetImpl.java:2147) at org.apache.sqoop.lib.JdbcWritableBridge.readDate (JdbcWritableBridge.java:115) at com.cloudera.sqoop.lib.JdbcWritableBridge.readDate (JdbcWritableBridge.java:87) at party_org.readFields (party_org.java:441) at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue ( DBRecordReader.java:244)... 12 more
Sqoop encountered an error when importing MySQL data when Timestamp column was empty. The solution is to add? zeroDateTimeBehavior=convertToNull after the JDBC connection.
For example:
Sqoop import-- driver com.mysql.jdbc.Driver-- connect jdbc:mysql://192.168.4.48:3306/xdgc?zeroDateTimeBehavior=convertToNull-- username root-- password-- table party_org-- hive-import-- hive-table ori.party_org-- incremental lastmodified-- check-column last_update_time-- last-value '2014-01-01 00VAND 00.000' Thank you for your reading The above is the content of "how to report an error when Sqoop encounters Timestamp as an empty time when importing MySQL data". After the study of this article, I believe you have a deeper understanding of how to report an error when Sqoop encounters Timestamp as a space-time error when importing MySQL data, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.