How to convert .txt file to Hadoop's sequence file format

后端 未结 7 1621
独厮守ぢ
独厮守ぢ 2020-11-29 01:19

To effectively utilise map-reduce jobs in Hadoop, i need data to be stored in hadoop\'s sequence file format. However,currently the data is only in flat .txt format.Can anyo

7条回答
  •  被撕碎了的回忆
    2020-11-29 02:11

    Be watchful with format specifier :.

    For example (note the space between % and s), System.out.printf("[% s]\t% s\t% s\n", writer.getLength(), key, value); will give us java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags =

    Instead, we should use:

    System.out.printf("[%s]\t%s\t%s\n", writer.getLength(), key, value); 
    

提交回复
热议问题