开发者

scala type mismatch error should be inherited

I've been working on getting a hadoop / scala bridge working on my machine and when I'm setting up the job I am getting the following error from the compiler.

[error]  found   : java.lang.Class[org.apache.hadoop.mapred.TextInputFormat (classOf[org.apache.hadoop.mapred.TextInputFormat])
[error]  required: java.lang.Class[_ <: org.apache.hadoop.mapred.InputFormat]
[error]     conf setInputFormat classOf[TextInputF开发者_StackOverflow中文版ormat]

I'm not sure how to proceed here given that TextInputFormat does in fact implement InputFormat.

(See: http://hadoop.apache.org/mapreduce/docs/current/api/org/apache/hadoop/mapred/TextInputFormat.html)

Is there a possibility that this isn't working b/c of a raw type issue where TextInputFormat implements InputFormat with a specific set of parameters?

Thanks for any help you can provide.

EDIT: also, for the offending line of code, conf is a JobConf, is one of these http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/mapred/JobConf.html


This looks like a known bug in Java-Scala interop with raw types, Issue SI 4603, which is now fixed in trunk. Could you try your code with a Scala nightly build and see if the issue is resolved?

See also: How does one implement a Hadoop Mapper in Scala 2.9.0?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜