获取java.lang.nullpointerexception hadoop map reduce程序

p4rjhz4m  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(268)

从db获取数据并加载到另一个表时,我遇到以下错误:

15/07/01 04:23:15 INFO mapreduce.Job: Task Id : attempt_1434100146148_0014_m_000000_0, Status : FAILED
Error: java.lang.NullPointerException
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:525)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:763)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:340)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:167)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1557)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)
vc6uscn9

vc6uscn91#

谢谢subba
上述问题已得到解决。我的输入sql查询中的列名有错误。我的查询为

select * from allTypes where**key**= ?;(correct) 
select * from allTypes where**id**= ?;(wrong ...no column as id)

相关问题