How to specify KeyValueTextInputFormat Separator in Hadoop-.20 api?

后端 未结 7 759
盖世英雄少女心
盖世英雄少女心 2020-12-08 05:57

In new API (apache.hadoop.mapreduce.KeyValueTextInputFormat) , how to specify separator (delimiter) other than tab(which is default) to separate key and Value.

Samp

7条回答
  •  一生所求
    2020-12-08 06:17

    By default, the KeyValueTextInputFormat class uses tab as a separator for key and value from input text file.

    If you want to read the input from a custom separator, then you have to set the configuration with the attribute that you are using.

    For the new Hadoop APIs, it is different:

    conf.set("mapreduce.input.keyvaluelinerecordreader.key.value.separator", ";");
    

提交回复
热议问题