MapReduce——LongWritable cannot be cast to org.apache.hadoop.io.Text 错误原因
来源:互联网 发布:怎样关闭136端口 xp 编辑:程序博客网 时间:2024/06/08 02:06
运行环境:虚拟机,Ubuntu16,Ubuntu Server 做Hadoop集群(一主两从),编程软件eclipse。
运行时出现如下错误:
(Hadoop的输入LongWritable不能转变为Text)
When you read a file with a M/R program, the input key of your mapper should be the index of the line in the file, while the input value will be the full line.So here what's happening is that you're trying to have the line index as a Text object which is wrong, and you need an LongWritable instead so that Hadoop doesn't complain about type.
在stackoverflow上找到了答案:当你用MapReduce程序读入文件是,mapper的输入key值应该是文件当前行的索引值,文件当前行的所有内容会被当做mapper的输入value值。所以Mapper程序的第一个参数(Mapper类的输入Key值)不可以具体化为LongWritable,可以用Text或者Object类。
参考stackoverflow:
https://stackoverflow.com/questions/11784729/hadoop-java-lang-classcastexception-org-apache-hadoop-io-longwritable-cannot
- MapReduce——LongWritable cannot be cast to org.apache.hadoop.io.Text 错误原因
- Hadoop-mapreduce org.apache.hadoop.io.LongWritable cannot be cast to org.apache.hadoop.io.Text错误
- MapReduce 异常 LongWritable cannot be cast to Text
- TaggedInputSplit cannot be cast to org.apache.hadoop.mapreduce.lib.input.FileSplit
- cannot be cast to org.apache.AnnotationProcessor 错误解决方案
- cannot be cast to org.apache
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.ap错误
- org.apache.hadoop.hive.metastore.api.InvalidOperationException cannot be cast to java.lang.RuntimeEx
- org.apache.struts2.dispatcher.FilterDispatcher cannot be cast to javax.servlet.Filter 错误
- org.apache.commons.beanutils.BasicDynaBean cannot be cast to ...
- Java 向Hbase表插入数据报(org.apache.hadoop.hbase.client.HTablePool$PooledHTable cannot be cast to org.apac
- Validator问题及解决办法——java.lang.ClassCastException: org.apache.struts.validator.ValidatorForm cannot be cast to forms.RegisterForm
- org.apache.struts.action.ActionMessage cannot be cast to org.apache.struts.action.ActionError
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
- org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
- echarts基本使用
- C语言数据结构——二叉树的顺序存储结构
- 【机房重构】-泛型与datatable
- 将mysql的查询结果保存到文件中
- MYSQL Identifying relationship 和non-Identifying relationship 区别。
- MapReduce——LongWritable cannot be cast to org.apache.hadoop.io.Text 错误原因
- Java多线程-3 线程同步之synchronized
- Swift计算属性和存储属性的重要区别
- python批量下载美女图片
- 【FCN实践】02 模型迁移及初始化
- leetcode572. Subtree of Another Tree
- Ubuntu新建用户组
- 《C陷阱与缺陷》读书笔记
- c++编译与链接