gpt4 book ai didi

hadoop - 无法在 hadoop mapreduce 中使用 KeyValueTextInputFormat 解析输入

转载 作者:可可西里 更新时间:2023-11-01 15:14:55 26 4
gpt4 key购买 nike

我的输入文件是这样的:

Key1 : Value1,Value2
Ket2 : Value3,Value4

在映射器中,我想获得一个键,其中“:”是定界符。为此,我的代码是这样的:

JobConf conf = new JobConf(newCount.class);    
conf.set("mapred.input.keyvaluelinerecordreader.key.value.separator", ":")
conf.setInputFormat(KeyValueTextInputFormat.class);

我也试过:

conf.set("key.value.separator.in.line.input.line", ":")

但无法解析。当我打印 key 时,它是这样打印的 --> key:我只想打印 ---> Key

最佳答案

如果使用 Hadoop 2.x,参数为

mapreduce.input.keyvaluelinerecordreader.key.value.separator

你能分享你的输入数据样本吗??

关于hadoop - 无法在 hadoop mapreduce 中使用 KeyValueTextInputFormat 解析输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26054995/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com