You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mrunit.apache.org by Ram Kumar <ra...@kuliza.com> on 2012/04/04 09:36:01 UTC

Key Value Separator in Output

There is one issue which I would like to bring to your knowledge in MRUNIT.
The Datatype 'Pair' return (key + ", " + value) in its toString() method.
However this will not be desired format in all cases.
Some cases we just need to have (key,value)  instead of (key, value)
Notice the space between , and value. Should we provide feature to set such
separators, rather than hardcoding it.

-- 
Thanks & Regards,
M.A. Ram Kumar

Re: Key Value Separator in Output

Posted by Brock Noland <br...@cloudera.com>.
Hi,

We are not using toString() to do the comparison... We do use
toString() when we report an error.

Brock

On Wed, Apr 4, 2012 at 7:21 AM, Ram Kumar <ra...@kuliza.com> wrote:
> Hi,
>
> Yeah I have seen those methods, but MRUNIT have their own way of comparing
> the outputs. I have modified the Path datatype to solve my issue. I have
> modified their toString() method and it works fine now. But i'm sure many
> users would have faced similar issue. So I think the best solution to this
> problem is to somewhere specify in the 'Path', the separator that should be
> used. I guess MRUNIT directly calls the toString method when it compares.
> Thanks for your time. Much appreciated :-)
>
>
> On Wed, Apr 4, 2012 at 4:46 PM, Brock Noland <br...@cloudera.com> wrote:
>
>> Hi,
>>
>> The Pair object contains two getters which you can use to get the key and
>> value.
>>
>> pair.getLeft().toString()
>> pair.getRight().toString()
>>
>> Would that suffice?
>>
>> Brock
>>
>> On Wed, Apr 4, 2012 at 3:36 AM, Ram Kumar <ra...@kuliza.com> wrote:
>> > There is one issue which I would like to bring to your knowledge in
>> MRUNIT.
>> > The Datatype 'Pair' return (key + ", " + value) in its toString() method.
>> > However this will not be desired format in all cases.
>> > Some cases we just need to have (key,value)  instead of (key, value)
>> > Notice the space between , and value. Should we provide feature to set
>> such
>> > separators, rather than hardcoding it.
>> >
>> > --
>> > Thanks & Regards,
>> > M.A. Ram Kumar
>>
>>
>>
>> --
>> Apache MRUnit - Unit testing MapReduce -
>> http://incubator.apache.org/mrunit/
>>
>
>
>
> --
> Regards,
> M.A. Ram Kumar
> Mobile : 9845564668



-- 
Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/

Re: Key Value Separator in Output

Posted by Ram Kumar <ra...@kuliza.com>.
Hi,

Yeah I have seen those methods, but MRUNIT have their own way of comparing
the outputs. I have modified the Path datatype to solve my issue. I have
modified their toString() method and it works fine now. But i'm sure many
users would have faced similar issue. So I think the best solution to this
problem is to somewhere specify in the 'Path', the separator that should be
used. I guess MRUNIT directly calls the toString method when it compares.
Thanks for your time. Much appreciated :-)


On Wed, Apr 4, 2012 at 4:46 PM, Brock Noland <br...@cloudera.com> wrote:

> Hi,
>
> The Pair object contains two getters which you can use to get the key and
> value.
>
> pair.getLeft().toString()
> pair.getRight().toString()
>
> Would that suffice?
>
> Brock
>
> On Wed, Apr 4, 2012 at 3:36 AM, Ram Kumar <ra...@kuliza.com> wrote:
> > There is one issue which I would like to bring to your knowledge in
> MRUNIT.
> > The Datatype 'Pair' return (key + ", " + value) in its toString() method.
> > However this will not be desired format in all cases.
> > Some cases we just need to have (key,value)  instead of (key, value)
> > Notice the space between , and value. Should we provide feature to set
> such
> > separators, rather than hardcoding it.
> >
> > --
> > Thanks & Regards,
> > M.A. Ram Kumar
>
>
>
> --
> Apache MRUnit - Unit testing MapReduce -
> http://incubator.apache.org/mrunit/
>



-- 
Regards,
M.A. Ram Kumar
Mobile : 9845564668

Re: Key Value Separator in Output

Posted by Brock Noland <br...@cloudera.com>.
Hi,

The Pair object contains two getters which you can use to get the key and value.

pair.getLeft().toString()
pair.getRight().toString()

Would that suffice?

Brock

On Wed, Apr 4, 2012 at 3:36 AM, Ram Kumar <ra...@kuliza.com> wrote:
> There is one issue which I would like to bring to your knowledge in MRUNIT.
> The Datatype 'Pair' return (key + ", " + value) in its toString() method.
> However this will not be desired format in all cases.
> Some cases we just need to have (key,value)  instead of (key, value)
> Notice the space between , and value. Should we provide feature to set such
> separators, rather than hardcoding it.
>
> --
> Thanks & Regards,
> M.A. Ram Kumar



-- 
Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/