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

后端 未结 7 758
盖世英雄少女心
盖世英雄少女心 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:07

    It's a sequence matter.

    The first line conf.set("key.value.separator.in.input.line", ",") must come before you create an instance of Job class. So:

    conf.set("key.value.separator.in.input.line", ","); 
    Job job = new Job(conf);
    

提交回复
热议问题