将mysql数据库中数据通过sqoop导入到hive中时报 java.io.IOException: SQLException in nextKeyValue
将mysql数据库中的数据通过sqoop导入到hive中时出现了这样的错误。语句:sqoopimport--connectjdbc:mysql://115.8.210.1...
将mysql数据库中的数据通过sqoop导入到hive中时出现了这样的错误。
语句:
sqoop import --connect jdbc:mysql://115.8.210.199:3306/employee --username root --password 123456 -e "select user_id from users WHERE reg_time >= 1309190400 AND reg_time <= 1309276800 AND \$CONDITIONS" --target-dir hdfs://namenodens2/users --fields-terminated-by "\001" --hive-import --hive-table dw.users --hive-partition-key dt --hive-partition-value 20110628 --hive-overwrite -m 1
错误信息如下:
java.io.IOException: SQLException in nextKeyValue
at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:266)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:483)
at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:76)
at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:85)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:139)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:672)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.sql
不要怀疑sql语句,已经在mysql上跑通了。
问题已经解决了,是查询中数据库中有时间格式的数据,而且数据值为空,就导致该问题发生了,感谢各位网友的热心帮助,这些财富值是你们的,真的属于你们。 展开
语句:
sqoop import --connect jdbc:mysql://115.8.210.199:3306/employee --username root --password 123456 -e "select user_id from users WHERE reg_time >= 1309190400 AND reg_time <= 1309276800 AND \$CONDITIONS" --target-dir hdfs://namenodens2/users --fields-terminated-by "\001" --hive-import --hive-table dw.users --hive-partition-key dt --hive-partition-value 20110628 --hive-overwrite -m 1
错误信息如下:
java.io.IOException: SQLException in nextKeyValue
at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:266)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:483)
at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:76)
at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:85)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:139)
at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:672)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)
Caused by: java.sql
不要怀疑sql语句,已经在mysql上跑通了。
问题已经解决了,是查询中数据库中有时间格式的数据,而且数据值为空,就导致该问题发生了,感谢各位网友的热心帮助,这些财富值是你们的,真的属于你们。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询