Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hadoop, mail # user - Simply reading small a hadoop text file.


Copy link to this message
-
Re: Simply reading small a hadoop text file.
Harsh J 2012-07-14, 02:18
You want the KeyValueTextInputFormat instead of TextInputFormat. It
has its default separator as tab, so you do not need to configure the
delimiter.

However, in case you do have to change the delimiter byte, use the
config: "mapreduce.input.keyvaluelinerecordreader.key.value.separator"

For more, see http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/mapred/KeyValueTextInputFormat.html

On Sat, Jul 14, 2012 at 6:00 AM, Jay Vyas <[EMAIL PROTECTED]> wrote:
> Hi guys : Whats the idiomatic way to iterate through the k/v pairs in a
> text file ? been playing with almost everything everything with
> SequenceFiles and almost forgot :)
>
> my text output actually has tabs in it... So, im not sure what the default
> separator is, and wehter or not there is a smart way to find the value.
>
> --
> Jay Vyas
> MMSB/UCHC

--
Harsh J