hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: Simply reading small a hadoop text file.
Date Sat, 14 Jul 2012 02:18:19 GMT
You want the KeyValueTextInputFormat instead of TextInputFormat. It
has its default separator as tab, so you do not need to configure the

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 <jayunit100@gmail.com> 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

Harsh J

View raw message