gpt4 book ai didi

hadoop - hadoop(PIG/MapReduce)如何处理非结构化文本数据

转载 作者:行者123 更新时间:2023-12-02 21:23:36 24 4
gpt4 key购买 nike

我正在处理非结构化文本文件。我想通过hadoop处理它
但是我从文件.pls帮助中提取所需数据时遇到问题。

我的文件看起来像:
enter image description here

我期望输出像;

enter image description here

最佳答案

众所周知,MapReduce可以忽略无效数据,至少您可以实现自己的map来做到这一点。

例如,定界符为\n,应接受具有指定格式的每一行,否则将被忽略。在这种情况下,每行包含6列,并以空格分隔。
//map
@Override
public void map(K key, V value, Context context)
throws IOException, InterruptedException
{
// value contains line content,
// verify value, only those valid lines should be accepted.
}

关于hadoop - hadoop(PIG/MapReduce)如何处理非结构化文本数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36680096/

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