gpt4 book ai didi

hadoop - 输入格式决定

转载 作者:可可西里 更新时间:2023-11-01 16:31:53 25 4
gpt4 key购买 nike

我想找出给定的答案中哪个最适合这个问题:

Given a directory of files with the following structure: line number, tab character, string:

Example:

1abialkjfjkaoasdfjksdlkjhqweroij

2kadfjhuwqounahagtnbvaswslmnbfgy

3kjfteiomndscxeqalkzhtopedkfsikj

You want to send each line as one record to your Mapper. Which InputFormat should you use to complete the line: conf.setInputFormat (____.class) ; ?

A. SequenceFileAsTextInputFormat

B. SequenceFileInputFormat

C. KeyValueFileInputFormat

D. BDBInputFormat

我的分析:

选项 A 是我发现存在的一种格式,但我不确定它的正确用法以及它是否适合作为答案。

选项 B 是不可能的,因为 SequenceFiles 是二进制数据 (K,V) 对二进制数据的文件,因此不适合..

选项 C 是不可能的,因为没有 KeyValueFileInputFormat,尽管在这里,如果它是一个拼写错误并且它实际上是 KeyValuetextInputFormat,那么我认为这将是一个不错的选择。或者不是吗?

选项 D 是不可能的,因为没有 BDBInputFormat,即使它是错字而且实际上是 BDInputFormat,但它不适合这种情况。

谢谢!

最佳答案

答案是选项C。可能是打错了

KeyValueTextInputFormat 帮助您使用 TAB 分割行。所以行号将是键,字符串将是值。

关于hadoop - 输入格式决定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27930385/

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