【发布时间】:2025-12-14 09:05:01
【问题描述】:
我正在与Hadoop MapRedue 合作,并且有一个问题。
目前,我的映射器的input KV type 是LongWritable, LongWritable type 和
output KV type 也是 LongWritable, LongWritable type。
InputFileFormat 是 SequenceFileInputFormat。
基本上我想要做的是将一个 txt 文件更改为 SequenceFileFormat 以便我可以将它用于我的映射器。
我想做的是
输入文件是这样的
1\t2 (key = 1, value = 2)
2\t3 (key = 2, value = 3)
不断……
我查看了这个帖子How to convert .txt file to Hadoop's sequence file format,但相信TextInputFormat 只支持Key = LongWritable and Value = Text
有什么方法可以在KV = LongWritable, LongWritable中获取txt并制作序列文件?
【问题讨论】: