You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-user@hadoop.apache.org by "Kartashov, Andy" <An...@mpac.ca> on 2012/10/02 15:31:50 UTC

puzzled at the output

Guys, have been stretching my head for the past couple of days.  Why are my tags duplicated while the content they wrap around i.e.my  StringBuilder sb is not?


My Reduce code is:
while (values.hasNext()){
    sb.append(values.next().toString());
   }
    output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));

The out put:
2459
<aaa>

<aaa>
        <value....
                .....
                ......
</bbbb>

</bbbb>

NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le pr?sent courriel et toute pi?ce jointe qui l'accompagne sont confidentiels, prot?g?s par le droit d'auteur et peuvent ?tre couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autoris?e est interdite. Si vous n'?tes pas le destinataire pr?vu de ce courriel, supprimez-le et contactez imm?diatement l'exp?diteur. Veuillez penser ? l'environnement avant d'imprimer le pr?sent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
Bertrand/Mohamed,

You guys are awesome!!!!. Thanks a million… Commenting out the Combiner class in the driver solved the issue.

p.s. I have one more small dilemma.
I am trying to create xml from two files. The input for my 3rd MR job is the (Text,Text) output from two MapReds. I feed my inputto MR3 as KeyValueTextInputFormat and whenever try to simply output out.collection(key,key). The keys are there.
My keys  are single value Text()  but the values is multi-line xml Text().
Can you put me in the right direction on how I can properly bring in these values to combine into a larger XML. For now the output of the 3rd MR job is a mess of values with the keys trailering somewhere at the bottom.

Andy Kartashov
MPAC
Architecture R&D, Co-op
1340 Pickering Parkway, Pickering, L1V 0C4
• Phone : (905) 837 6269
• Mobile: (416) 722 1787
andy.kartashov@mpac.ca<ma...@mpac.ca>

From: Mohamed Trad [mailto:riadh.trad@inria.fr]
Sent: Tuesday, October 02, 2012 1:35 PM
To: user@hadoop.apache.org
Cc: user@hadoop.apache.org
Subject: Re: puzzled at the output

I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com>> a écrit :
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand
On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>> wrote:
Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?

Thank you,
--Chris
On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>> wrote:
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com<ma...@cloudera.com>]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org<ma...@hadoop.apache.org>
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my<http://i.e.my>
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel




--
Bertrand Dechoux
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
Bertrand/Mohamed,

You guys are awesome!!!!. Thanks a million… Commenting out the Combiner class in the driver solved the issue.

p.s. I have one more small dilemma.
I am trying to create xml from two files. The input for my 3rd MR job is the (Text,Text) output from two MapReds. I feed my inputto MR3 as KeyValueTextInputFormat and whenever try to simply output out.collection(key,key). The keys are there.
My keys  are single value Text()  but the values is multi-line xml Text().
Can you put me in the right direction on how I can properly bring in these values to combine into a larger XML. For now the output of the 3rd MR job is a mess of values with the keys trailering somewhere at the bottom.

Andy Kartashov
MPAC
Architecture R&D, Co-op
1340 Pickering Parkway, Pickering, L1V 0C4
• Phone : (905) 837 6269
• Mobile: (416) 722 1787
andy.kartashov@mpac.ca<ma...@mpac.ca>

From: Mohamed Trad [mailto:riadh.trad@inria.fr]
Sent: Tuesday, October 02, 2012 1:35 PM
To: user@hadoop.apache.org
Cc: user@hadoop.apache.org
Subject: Re: puzzled at the output

I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com>> a écrit :
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand
On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>> wrote:
Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?

Thank you,
--Chris
On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>> wrote:
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com<ma...@cloudera.com>]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org<ma...@hadoop.apache.org>
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my<http://i.e.my>
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel




--
Bertrand Dechoux
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
Bertrand/Mohamed,

You guys are awesome!!!!. Thanks a million… Commenting out the Combiner class in the driver solved the issue.

p.s. I have one more small dilemma.
I am trying to create xml from two files. The input for my 3rd MR job is the (Text,Text) output from two MapReds. I feed my inputto MR3 as KeyValueTextInputFormat and whenever try to simply output out.collection(key,key). The keys are there.
My keys  are single value Text()  but the values is multi-line xml Text().
Can you put me in the right direction on how I can properly bring in these values to combine into a larger XML. For now the output of the 3rd MR job is a mess of values with the keys trailering somewhere at the bottom.

Andy Kartashov
MPAC
Architecture R&D, Co-op
1340 Pickering Parkway, Pickering, L1V 0C4
• Phone : (905) 837 6269
• Mobile: (416) 722 1787
andy.kartashov@mpac.ca<ma...@mpac.ca>

From: Mohamed Trad [mailto:riadh.trad@inria.fr]
Sent: Tuesday, October 02, 2012 1:35 PM
To: user@hadoop.apache.org
Cc: user@hadoop.apache.org
Subject: Re: puzzled at the output

I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com>> a écrit :
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand
On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>> wrote:
Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?

Thank you,
--Chris
On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>> wrote:
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com<ma...@cloudera.com>]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org<ma...@hadoop.apache.org>
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my<http://i.e.my>
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel




--
Bertrand Dechoux
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
Bertrand/Mohamed,

You guys are awesome!!!!. Thanks a million… Commenting out the Combiner class in the driver solved the issue.

p.s. I have one more small dilemma.
I am trying to create xml from two files. The input for my 3rd MR job is the (Text,Text) output from two MapReds. I feed my inputto MR3 as KeyValueTextInputFormat and whenever try to simply output out.collection(key,key). The keys are there.
My keys  are single value Text()  but the values is multi-line xml Text().
Can you put me in the right direction on how I can properly bring in these values to combine into a larger XML. For now the output of the 3rd MR job is a mess of values with the keys trailering somewhere at the bottom.

Andy Kartashov
MPAC
Architecture R&D, Co-op
1340 Pickering Parkway, Pickering, L1V 0C4
• Phone : (905) 837 6269
• Mobile: (416) 722 1787
andy.kartashov@mpac.ca<ma...@mpac.ca>

From: Mohamed Trad [mailto:riadh.trad@inria.fr]
Sent: Tuesday, October 02, 2012 1:35 PM
To: user@hadoop.apache.org
Cc: user@hadoop.apache.org
Subject: Re: puzzled at the output

I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com>> a écrit :
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand
On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>> wrote:
Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?

Thank you,
--Chris
On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>> wrote:
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com<ma...@cloudera.com>]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org<ma...@hadoop.apache.org>
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my<http://i.e.my>
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel




--
Bertrand Dechoux
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

Re: puzzled at the output

Posted by Mohamed Trad <ri...@inria.fr>.
I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com> a écrit :

> Combiner? And you are only using 'Text' as type?
> 
> Please do a real test with a specified input. We can only guess.
> 
> Bertrand
> 
> On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com> wrote:
>> Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?
>> 
>> Thank you,
>> --Chris
>> 
>> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> I want:
>>> 
>>> Key  <tag>
>>>           Value1
>>>           Value2
>>>         </tag>
>>> 
>>> I get double tags:
>>> Key  <tag><tag>
>>>           Value1
>>>           Value2
>>>         </tag></tag>
>>> 
>>> Here is my last proposition that also failed in Reduce.
>>> 
>>> ...
>>> public void reduce (.....
>>> ....
>>> StringBuilder sb = new StringBuilder();
>>> while (values.hasNext()){
>>>      sb.append(values.next().toString());
>>>     }
>>> 
>>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>> 
>>> Kind regards,
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Harsh J [mailto:harsh@cloudera.com]
>>> Sent: Tuesday, October 02, 2012 10:03 AM
>>> To: user@hadoop.apache.org
>>> Subject: Re: puzzled at the output
>>> 
>>> Hi,
>>> 
>>> Could you clarify your post to show what you expect your code to have actually printed and what it has printed?
>>> 
>>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> > Guys, have been stretching my head for the past couple of days.  Why
>>> > are my tags duplicated while the content they wrap around i.e.my
>>> > StringBuilder sb is not?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > My Reduce code is:
>>> >
>>> > while (values.hasNext()){
>>> >
>>> >     sb.append(values.next().toString());
>>> >
>>> >    }
>>> >
>>> >     output.collect(key,new
>>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>>> >
>>> >
>>> >
>>> > The out put:
>>> >
>>> > 2459
>>> >
>>> > <aaa>
>>> >
>>> >
>>> >
>>> > <aaa>
>>> >
>>> >         <value....
>>> >
>>> >                 .....
>>> >
>>> >                 ......
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > NOTICE: This e-mail message and any attachments are confidential,
>>> > subject to copyright and may be privileged. Any unauthorized use,
>>> > copying or disclosure is prohibited. If you are not the intended
>>> > recipient, please delete and contact the sender immediately. Please
>>> > consider the environment before printing this e-mail. AVIS : le
>>> > présent courriel et toute pièce jointe qui l'accompagne sont
>>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>> 
>>> 
>>> 
>>> --
>>> Harsh J
>>> NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel
> 
> 
> 
> -- 
> Bertrand Dechoux

Re: puzzled at the output

Posted by Mohamed Trad <ri...@inria.fr>.
I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com> a écrit :

> Combiner? And you are only using 'Text' as type?
> 
> Please do a real test with a specified input. We can only guess.
> 
> Bertrand
> 
> On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com> wrote:
>> Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?
>> 
>> Thank you,
>> --Chris
>> 
>> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> I want:
>>> 
>>> Key  <tag>
>>>           Value1
>>>           Value2
>>>         </tag>
>>> 
>>> I get double tags:
>>> Key  <tag><tag>
>>>           Value1
>>>           Value2
>>>         </tag></tag>
>>> 
>>> Here is my last proposition that also failed in Reduce.
>>> 
>>> ...
>>> public void reduce (.....
>>> ....
>>> StringBuilder sb = new StringBuilder();
>>> while (values.hasNext()){
>>>      sb.append(values.next().toString());
>>>     }
>>> 
>>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>> 
>>> Kind regards,
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Harsh J [mailto:harsh@cloudera.com]
>>> Sent: Tuesday, October 02, 2012 10:03 AM
>>> To: user@hadoop.apache.org
>>> Subject: Re: puzzled at the output
>>> 
>>> Hi,
>>> 
>>> Could you clarify your post to show what you expect your code to have actually printed and what it has printed?
>>> 
>>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> > Guys, have been stretching my head for the past couple of days.  Why
>>> > are my tags duplicated while the content they wrap around i.e.my
>>> > StringBuilder sb is not?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > My Reduce code is:
>>> >
>>> > while (values.hasNext()){
>>> >
>>> >     sb.append(values.next().toString());
>>> >
>>> >    }
>>> >
>>> >     output.collect(key,new
>>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>>> >
>>> >
>>> >
>>> > The out put:
>>> >
>>> > 2459
>>> >
>>> > <aaa>
>>> >
>>> >
>>> >
>>> > <aaa>
>>> >
>>> >         <value....
>>> >
>>> >                 .....
>>> >
>>> >                 ......
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > NOTICE: This e-mail message and any attachments are confidential,
>>> > subject to copyright and may be privileged. Any unauthorized use,
>>> > copying or disclosure is prohibited. If you are not the intended
>>> > recipient, please delete and contact the sender immediately. Please
>>> > consider the environment before printing this e-mail. AVIS : le
>>> > présent courriel et toute pièce jointe qui l'accompagne sont
>>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>> 
>>> 
>>> 
>>> --
>>> Harsh J
>>> NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel
> 
> 
> 
> -- 
> Bertrand Dechoux

Re: puzzled at the output

Posted by Mohamed Trad <ri...@inria.fr>.
I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com> a écrit :

> Combiner? And you are only using 'Text' as type?
> 
> Please do a real test with a specified input. We can only guess.
> 
> Bertrand
> 
> On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com> wrote:
>> Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?
>> 
>> Thank you,
>> --Chris
>> 
>> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> I want:
>>> 
>>> Key  <tag>
>>>           Value1
>>>           Value2
>>>         </tag>
>>> 
>>> I get double tags:
>>> Key  <tag><tag>
>>>           Value1
>>>           Value2
>>>         </tag></tag>
>>> 
>>> Here is my last proposition that also failed in Reduce.
>>> 
>>> ...
>>> public void reduce (.....
>>> ....
>>> StringBuilder sb = new StringBuilder();
>>> while (values.hasNext()){
>>>      sb.append(values.next().toString());
>>>     }
>>> 
>>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>> 
>>> Kind regards,
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Harsh J [mailto:harsh@cloudera.com]
>>> Sent: Tuesday, October 02, 2012 10:03 AM
>>> To: user@hadoop.apache.org
>>> Subject: Re: puzzled at the output
>>> 
>>> Hi,
>>> 
>>> Could you clarify your post to show what you expect your code to have actually printed and what it has printed?
>>> 
>>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> > Guys, have been stretching my head for the past couple of days.  Why
>>> > are my tags duplicated while the content they wrap around i.e.my
>>> > StringBuilder sb is not?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > My Reduce code is:
>>> >
>>> > while (values.hasNext()){
>>> >
>>> >     sb.append(values.next().toString());
>>> >
>>> >    }
>>> >
>>> >     output.collect(key,new
>>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>>> >
>>> >
>>> >
>>> > The out put:
>>> >
>>> > 2459
>>> >
>>> > <aaa>
>>> >
>>> >
>>> >
>>> > <aaa>
>>> >
>>> >         <value....
>>> >
>>> >                 .....
>>> >
>>> >                 ......
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > NOTICE: This e-mail message and any attachments are confidential,
>>> > subject to copyright and may be privileged. Any unauthorized use,
>>> > copying or disclosure is prohibited. If you are not the intended
>>> > recipient, please delete and contact the sender immediately. Please
>>> > consider the environment before printing this e-mail. AVIS : le
>>> > présent courriel et toute pièce jointe qui l'accompagne sont
>>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>> 
>>> 
>>> 
>>> --
>>> Harsh J
>>> NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel
> 
> 
> 
> -- 
> Bertrand Dechoux

Re: puzzled at the output

Posted by Mohamed Trad <ri...@inria.fr>.
I agree with Bertrand. Try disabling the combiner.

Envoyé de mon iPhone

Le 2 oct. 2012 à 19:02, Bertrand Dechoux <de...@gmail.com> a écrit :

> Combiner? And you are only using 'Text' as type?
> 
> Please do a real test with a specified input. We can only guess.
> 
> Bertrand
> 
> On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com> wrote:
>> Is there also a Mapper?  Is there any chance that logic in the Mapper wrapped the values with the tags too, so that the records were already wrapped when they entered the reducer logic?
>> 
>> Thank you,
>> --Chris
>> 
>> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> I want:
>>> 
>>> Key  <tag>
>>>           Value1
>>>           Value2
>>>         </tag>
>>> 
>>> I get double tags:
>>> Key  <tag><tag>
>>>           Value1
>>>           Value2
>>>         </tag></tag>
>>> 
>>> Here is my last proposition that also failed in Reduce.
>>> 
>>> ...
>>> public void reduce (.....
>>> ....
>>> StringBuilder sb = new StringBuilder();
>>> while (values.hasNext()){
>>>      sb.append(values.next().toString());
>>>     }
>>> 
>>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>> 
>>> Kind regards,
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Harsh J [mailto:harsh@cloudera.com]
>>> Sent: Tuesday, October 02, 2012 10:03 AM
>>> To: user@hadoop.apache.org
>>> Subject: Re: puzzled at the output
>>> 
>>> Hi,
>>> 
>>> Could you clarify your post to show what you expect your code to have actually printed and what it has printed?
>>> 
>>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
>>> > Guys, have been stretching my head for the past couple of days.  Why
>>> > are my tags duplicated while the content they wrap around i.e.my
>>> > StringBuilder sb is not?
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > My Reduce code is:
>>> >
>>> > while (values.hasNext()){
>>> >
>>> >     sb.append(values.next().toString());
>>> >
>>> >    }
>>> >
>>> >     output.collect(key,new
>>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>>> >
>>> >
>>> >
>>> > The out put:
>>> >
>>> > 2459
>>> >
>>> > <aaa>
>>> >
>>> >
>>> >
>>> > <aaa>
>>> >
>>> >         <value....
>>> >
>>> >                 .....
>>> >
>>> >                 ......
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > </bbbb>
>>> >
>>> >
>>> >
>>> > NOTICE: This e-mail message and any attachments are confidential,
>>> > subject to copyright and may be privileged. Any unauthorized use,
>>> > copying or disclosure is prohibited. If you are not the intended
>>> > recipient, please delete and contact the sender immediately. Please
>>> > consider the environment before printing this e-mail. AVIS : le
>>> > présent courriel et toute pièce jointe qui l'accompagne sont
>>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>> 
>>> 
>>> 
>>> --
>>> Harsh J
>>> NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel
> 
> 
> 
> -- 
> Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand

On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>wrote:

> Is there also a Mapper?  Is there any chance that logic in the Mapper
> wrapped the values with the tags too, so that the records were already
> wrapped when they entered the reducer logic?
>
> Thank you,
> --Chris
>
> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:
>
>> I want:
>>
>> Key  <tag>
>>           Value1
>>           Value2
>>         </tag>
>>
>> I get double tags:
>> Key  <tag><tag>
>>           Value1
>>           Value2
>>         </tag></tag>
>>
>> Here is my last proposition that also failed in Reduce.
>>
>> ...
>> public void reduce (.....
>> ....
>> StringBuilder sb = new StringBuilder();
>> while (values.hasNext()){
>>      sb.append(values.next().toString());
>>     }
>>
>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>
>> Kind regards,
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Harsh J [mailto:harsh@cloudera.com]
>> Sent: Tuesday, October 02, 2012 10:03 AM
>> To: user@hadoop.apache.org
>> Subject: Re: puzzled at the output
>>
>> Hi,
>>
>> Could you clarify your post to show what you expect your code to have
>> actually printed and what it has printed?
>>
>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
>> wrote:
>> > Guys, have been stretching my head for the past couple of days.  Why
>> > are my tags duplicated while the content they wrap around i.e.my
>> > StringBuilder sb is not?
>> >
>> >
>> >
>> >
>> >
>> > My Reduce code is:
>> >
>> > while (values.hasNext()){
>> >
>> >     sb.append(values.next().toString());
>> >
>> >    }
>> >
>> >     output.collect(key,new
>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>> >
>> >
>> >
>> > The out put:
>> >
>> > 2459
>> >
>> > <aaa>
>> >
>> >
>> >
>> > <aaa>
>> >
>> >         <value....
>> >
>> >                 .....
>> >
>> >                 ......
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > NOTICE: This e-mail message and any attachments are confidential,
>> > subject to copyright and may be privileged. Any unauthorized use,
>> > copying or disclosure is prohibited. If you are not the intended
>> > recipient, please delete and contact the sender immediately. Please
>> > consider the environment before printing this e-mail. AVIS : le
>> > présent courriel et toute pièce jointe qui l'accompagne sont
>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu
>> de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>
>>
>>
>> --
>> Harsh J
>> NOTICE: This e-mail message and any attachments are confidential, subject
>> to copyright and may be privileged. Any unauthorized use, copying or
>> disclosure is prohibited. If you are not the intended recipient, please
>> delete and contact the sender immediately. Please consider the environment
>> before printing this e-mail. AVIS : le présent courriel et toute pièce
>> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
>> et peuvent être couverts par le secret professionnel. Toute utilisation,
>> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
>> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
>> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
>> courriel
>>
>
>


-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand

On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>wrote:

> Is there also a Mapper?  Is there any chance that logic in the Mapper
> wrapped the values with the tags too, so that the records were already
> wrapped when they entered the reducer logic?
>
> Thank you,
> --Chris
>
> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:
>
>> I want:
>>
>> Key  <tag>
>>           Value1
>>           Value2
>>         </tag>
>>
>> I get double tags:
>> Key  <tag><tag>
>>           Value1
>>           Value2
>>         </tag></tag>
>>
>> Here is my last proposition that also failed in Reduce.
>>
>> ...
>> public void reduce (.....
>> ....
>> StringBuilder sb = new StringBuilder();
>> while (values.hasNext()){
>>      sb.append(values.next().toString());
>>     }
>>
>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>
>> Kind regards,
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Harsh J [mailto:harsh@cloudera.com]
>> Sent: Tuesday, October 02, 2012 10:03 AM
>> To: user@hadoop.apache.org
>> Subject: Re: puzzled at the output
>>
>> Hi,
>>
>> Could you clarify your post to show what you expect your code to have
>> actually printed and what it has printed?
>>
>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
>> wrote:
>> > Guys, have been stretching my head for the past couple of days.  Why
>> > are my tags duplicated while the content they wrap around i.e.my
>> > StringBuilder sb is not?
>> >
>> >
>> >
>> >
>> >
>> > My Reduce code is:
>> >
>> > while (values.hasNext()){
>> >
>> >     sb.append(values.next().toString());
>> >
>> >    }
>> >
>> >     output.collect(key,new
>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>> >
>> >
>> >
>> > The out put:
>> >
>> > 2459
>> >
>> > <aaa>
>> >
>> >
>> >
>> > <aaa>
>> >
>> >         <value....
>> >
>> >                 .....
>> >
>> >                 ......
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > NOTICE: This e-mail message and any attachments are confidential,
>> > subject to copyright and may be privileged. Any unauthorized use,
>> > copying or disclosure is prohibited. If you are not the intended
>> > recipient, please delete and contact the sender immediately. Please
>> > consider the environment before printing this e-mail. AVIS : le
>> > présent courriel et toute pièce jointe qui l'accompagne sont
>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu
>> de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>
>>
>>
>> --
>> Harsh J
>> NOTICE: This e-mail message and any attachments are confidential, subject
>> to copyright and may be privileged. Any unauthorized use, copying or
>> disclosure is prohibited. If you are not the intended recipient, please
>> delete and contact the sender immediately. Please consider the environment
>> before printing this e-mail. AVIS : le présent courriel et toute pièce
>> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
>> et peuvent être couverts par le secret professionnel. Toute utilisation,
>> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
>> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
>> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
>> courriel
>>
>
>


-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand

On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>wrote:

> Is there also a Mapper?  Is there any chance that logic in the Mapper
> wrapped the values with the tags too, so that the records were already
> wrapped when they entered the reducer logic?
>
> Thank you,
> --Chris
>
> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:
>
>> I want:
>>
>> Key  <tag>
>>           Value1
>>           Value2
>>         </tag>
>>
>> I get double tags:
>> Key  <tag><tag>
>>           Value1
>>           Value2
>>         </tag></tag>
>>
>> Here is my last proposition that also failed in Reduce.
>>
>> ...
>> public void reduce (.....
>> ....
>> StringBuilder sb = new StringBuilder();
>> while (values.hasNext()){
>>      sb.append(values.next().toString());
>>     }
>>
>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>
>> Kind regards,
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Harsh J [mailto:harsh@cloudera.com]
>> Sent: Tuesday, October 02, 2012 10:03 AM
>> To: user@hadoop.apache.org
>> Subject: Re: puzzled at the output
>>
>> Hi,
>>
>> Could you clarify your post to show what you expect your code to have
>> actually printed and what it has printed?
>>
>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
>> wrote:
>> > Guys, have been stretching my head for the past couple of days.  Why
>> > are my tags duplicated while the content they wrap around i.e.my
>> > StringBuilder sb is not?
>> >
>> >
>> >
>> >
>> >
>> > My Reduce code is:
>> >
>> > while (values.hasNext()){
>> >
>> >     sb.append(values.next().toString());
>> >
>> >    }
>> >
>> >     output.collect(key,new
>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>> >
>> >
>> >
>> > The out put:
>> >
>> > 2459
>> >
>> > <aaa>
>> >
>> >
>> >
>> > <aaa>
>> >
>> >         <value....
>> >
>> >                 .....
>> >
>> >                 ......
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > NOTICE: This e-mail message and any attachments are confidential,
>> > subject to copyright and may be privileged. Any unauthorized use,
>> > copying or disclosure is prohibited. If you are not the intended
>> > recipient, please delete and contact the sender immediately. Please
>> > consider the environment before printing this e-mail. AVIS : le
>> > présent courriel et toute pièce jointe qui l'accompagne sont
>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu
>> de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>
>>
>>
>> --
>> Harsh J
>> NOTICE: This e-mail message and any attachments are confidential, subject
>> to copyright and may be privileged. Any unauthorized use, copying or
>> disclosure is prohibited. If you are not the intended recipient, please
>> delete and contact the sender immediately. Please consider the environment
>> before printing this e-mail. AVIS : le présent courriel et toute pièce
>> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
>> et peuvent être couverts par le secret professionnel. Toute utilisation,
>> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
>> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
>> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
>> courriel
>>
>
>


-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
Combiner? And you are only using 'Text' as type?

Please do a real test with a specified input. We can only guess.

Bertrand

On Tue, Oct 2, 2012 at 6:52 PM, Chris Nauroth <cn...@hortonworks.com>wrote:

> Is there also a Mapper?  Is there any chance that logic in the Mapper
> wrapped the values with the tags too, so that the records were already
> wrapped when they entered the reducer logic?
>
> Thank you,
> --Chris
>
> On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:
>
>> I want:
>>
>> Key  <tag>
>>           Value1
>>           Value2
>>         </tag>
>>
>> I get double tags:
>> Key  <tag><tag>
>>           Value1
>>           Value2
>>         </tag></tag>
>>
>> Here is my last proposition that also failed in Reduce.
>>
>> ...
>> public void reduce (.....
>> ....
>> StringBuilder sb = new StringBuilder();
>> while (values.hasNext()){
>>      sb.append(values.next().toString());
>>     }
>>
>> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>>
>> Kind regards,
>>
>>
>>
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Harsh J [mailto:harsh@cloudera.com]
>> Sent: Tuesday, October 02, 2012 10:03 AM
>> To: user@hadoop.apache.org
>> Subject: Re: puzzled at the output
>>
>> Hi,
>>
>> Could you clarify your post to show what you expect your code to have
>> actually printed and what it has printed?
>>
>> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
>> wrote:
>> > Guys, have been stretching my head for the past couple of days.  Why
>> > are my tags duplicated while the content they wrap around i.e.my
>> > StringBuilder sb is not?
>> >
>> >
>> >
>> >
>> >
>> > My Reduce code is:
>> >
>> > while (values.hasNext()){
>> >
>> >     sb.append(values.next().toString());
>> >
>> >    }
>> >
>> >     output.collect(key,new
>> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>> >
>> >
>> >
>> > The out put:
>> >
>> > 2459
>> >
>> > <aaa>
>> >
>> >
>> >
>> > <aaa>
>> >
>> >         <value....
>> >
>> >                 .....
>> >
>> >                 ......
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > </bbbb>
>> >
>> >
>> >
>> > NOTICE: This e-mail message and any attachments are confidential,
>> > subject to copyright and may be privileged. Any unauthorized use,
>> > copying or disclosure is prohibited. If you are not the intended
>> > recipient, please delete and contact the sender immediately. Please
>> > consider the environment before printing this e-mail. AVIS : le
>> > présent courriel et toute pièce jointe qui l'accompagne sont
>> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
>> > par le secret professionnel. Toute utilisation, copie ou divulgation
>> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu
>> de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
>> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>>
>>
>>
>> --
>> Harsh J
>> NOTICE: This e-mail message and any attachments are confidential, subject
>> to copyright and may be privileged. Any unauthorized use, copying or
>> disclosure is prohibited. If you are not the intended recipient, please
>> delete and contact the sender immediately. Please consider the environment
>> before printing this e-mail. AVIS : le présent courriel et toute pièce
>> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
>> et peuvent être couverts par le secret professionnel. Toute utilisation,
>> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
>> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
>> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
>> courriel
>>
>
>


-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Chris Nauroth <cn...@hortonworks.com>.
Is there also a Mapper?  Is there any chance that logic in the Mapper
wrapped the values with the tags too, so that the records were already
wrapped when they entered the reducer logic?

Thank you,
--Chris

On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:

> I want:
>
> Key  <tag>
>           Value1
>           Value2
>         </tag>
>
> I get double tags:
> Key  <tag><tag>
>           Value1
>           Value2
>         </tag></tag>
>
> Here is my last proposition that also failed in Reduce.
>
> ...
> public void reduce (.....
> ....
> StringBuilder sb = new StringBuilder();
> while (values.hasNext()){
>      sb.append(values.next().toString());
>     }
>
> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>
> Kind regards,
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Harsh J [mailto:harsh@cloudera.com]
> Sent: Tuesday, October 02, 2012 10:03 AM
> To: user@hadoop.apache.org
> Subject: Re: puzzled at the output
>
> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why
> > are my tags duplicated while the content they wrap around i.e.my
> > StringBuilder sb is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new
> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value....
> >
> >                 .....
> >
> >                 ......
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> > subject to copyright and may be privileged. Any unauthorized use,
> > copying or disclosure is prohibited. If you are not the intended
> > recipient, please delete and contact the sender immediately. Please
> > consider the environment before printing this e-mail. AVIS : le
> > présent courriel et toute pièce jointe qui l'accompagne sont
> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
> > par le secret professionnel. Toute utilisation, copie ou divulgation
> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de
> ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
> NOTICE: This e-mail message and any attachments are confidential, subject
> to copyright and may be privileged. Any unauthorized use, copying or
> disclosure is prohibited. If you are not the intended recipient, please
> delete and contact the sender immediately. Please consider the environment
> before printing this e-mail. AVIS : le présent courriel et toute pièce
> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
> et peuvent être couverts par le secret professionnel. Toute utilisation,
> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
> courriel
>

Re: puzzled at the output

Posted by Chris Nauroth <cn...@hortonworks.com>.
Is there also a Mapper?  Is there any chance that logic in the Mapper
wrapped the values with the tags too, so that the records were already
wrapped when they entered the reducer logic?

Thank you,
--Chris

On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:

> I want:
>
> Key  <tag>
>           Value1
>           Value2
>         </tag>
>
> I get double tags:
> Key  <tag><tag>
>           Value1
>           Value2
>         </tag></tag>
>
> Here is my last proposition that also failed in Reduce.
>
> ...
> public void reduce (.....
> ....
> StringBuilder sb = new StringBuilder();
> while (values.hasNext()){
>      sb.append(values.next().toString());
>     }
>
> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>
> Kind regards,
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Harsh J [mailto:harsh@cloudera.com]
> Sent: Tuesday, October 02, 2012 10:03 AM
> To: user@hadoop.apache.org
> Subject: Re: puzzled at the output
>
> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why
> > are my tags duplicated while the content they wrap around i.e.my
> > StringBuilder sb is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new
> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value....
> >
> >                 .....
> >
> >                 ......
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> > subject to copyright and may be privileged. Any unauthorized use,
> > copying or disclosure is prohibited. If you are not the intended
> > recipient, please delete and contact the sender immediately. Please
> > consider the environment before printing this e-mail. AVIS : le
> > présent courriel et toute pièce jointe qui l'accompagne sont
> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
> > par le secret professionnel. Toute utilisation, copie ou divulgation
> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de
> ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
> NOTICE: This e-mail message and any attachments are confidential, subject
> to copyright and may be privileged. Any unauthorized use, copying or
> disclosure is prohibited. If you are not the intended recipient, please
> delete and contact the sender immediately. Please consider the environment
> before printing this e-mail. AVIS : le présent courriel et toute pièce
> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
> et peuvent être couverts par le secret professionnel. Toute utilisation,
> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
> courriel
>

Re: puzzled at the output

Posted by Chris Nauroth <cn...@hortonworks.com>.
Is there also a Mapper?  Is there any chance that logic in the Mapper
wrapped the values with the tags too, so that the records were already
wrapped when they entered the reducer logic?

Thank you,
--Chris

On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:

> I want:
>
> Key  <tag>
>           Value1
>           Value2
>         </tag>
>
> I get double tags:
> Key  <tag><tag>
>           Value1
>           Value2
>         </tag></tag>
>
> Here is my last proposition that also failed in Reduce.
>
> ...
> public void reduce (.....
> ....
> StringBuilder sb = new StringBuilder();
> while (values.hasNext()){
>      sb.append(values.next().toString());
>     }
>
> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>
> Kind regards,
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Harsh J [mailto:harsh@cloudera.com]
> Sent: Tuesday, October 02, 2012 10:03 AM
> To: user@hadoop.apache.org
> Subject: Re: puzzled at the output
>
> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why
> > are my tags duplicated while the content they wrap around i.e.my
> > StringBuilder sb is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new
> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value....
> >
> >                 .....
> >
> >                 ......
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> > subject to copyright and may be privileged. Any unauthorized use,
> > copying or disclosure is prohibited. If you are not the intended
> > recipient, please delete and contact the sender immediately. Please
> > consider the environment before printing this e-mail. AVIS : le
> > présent courriel et toute pièce jointe qui l'accompagne sont
> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
> > par le secret professionnel. Toute utilisation, copie ou divulgation
> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de
> ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
> NOTICE: This e-mail message and any attachments are confidential, subject
> to copyright and may be privileged. Any unauthorized use, copying or
> disclosure is prohibited. If you are not the intended recipient, please
> delete and contact the sender immediately. Please consider the environment
> before printing this e-mail. AVIS : le présent courriel et toute pièce
> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
> et peuvent être couverts par le secret professionnel. Toute utilisation,
> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
> courriel
>

Re: puzzled at the output

Posted by Chris Nauroth <cn...@hortonworks.com>.
Is there also a Mapper?  Is there any chance that logic in the Mapper
wrapped the values with the tags too, so that the records were already
wrapped when they entered the reducer logic?

Thank you,
--Chris

On Tue, Oct 2, 2012 at 9:01 AM, Kartashov, Andy <An...@mpac.ca>wrote:

> I want:
>
> Key  <tag>
>           Value1
>           Value2
>         </tag>
>
> I get double tags:
> Key  <tag><tag>
>           Value1
>           Value2
>         </tag></tag>
>
> Here is my last proposition that also failed in Reduce.
>
> ...
> public void reduce (.....
> ....
> StringBuilder sb = new StringBuilder();
> while (values.hasNext()){
>      sb.append(values.next().toString());
>     }
>
> output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));
>
> Kind regards,
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Harsh J [mailto:harsh@cloudera.com]
> Sent: Tuesday, October 02, 2012 10:03 AM
> To: user@hadoop.apache.org
> Subject: Re: puzzled at the output
>
> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why
> > are my tags duplicated while the content they wrap around i.e.my
> > StringBuilder sb is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new
> > Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value....
> >
> >                 .....
> >
> >                 ......
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> > subject to copyright and may be privileged. Any unauthorized use,
> > copying or disclosure is prohibited. If you are not the intended
> > recipient, please delete and contact the sender immediately. Please
> > consider the environment before printing this e-mail. AVIS : le
> > présent courriel et toute pièce jointe qui l'accompagne sont
> > confidentiels, protégés par le droit d'auteur et peuvent être couverts
> > par le secret professionnel. Toute utilisation, copie ou divulgation
> > non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de
> ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
> NOTICE: This e-mail message and any attachments are confidential, subject
> to copyright and may be privileged. Any unauthorized use, copying or
> disclosure is prohibited. If you are not the intended recipient, please
> delete and contact the sender immediately. Please consider the environment
> before printing this e-mail. AVIS : le présent courriel et toute pièce
> jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur
> et peuvent être couverts par le secret professionnel. Toute utilisation,
> copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent
> courriel
>

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
And a simple way to do that is actually writing a unit test, with MRunit
for exemple.

A little sample for a a full mapper-reducer test :

MapReduceDriver.newMapReduceDriver(new WordCountMapper(),new
WordCountReducer())
// given             .withInput(new LongWritable(1), new Text("word1 word2
word2 word1"))//
// then             .withOutput(new Text("word1"), new
LongWritable(2))//
.withOutput(new Text("word2"), new LongWritable(2))//
// when             .runTest();

Of course, there is also a MapDriver and a ReduceDriver. And
MRunitsupports both mapred and mapreduce packages.
So you should be able to apply it to your project.

Regards

Bertrand

On Tue, Oct 2, 2012 at 4:03 PM, Harsh J <ha...@cloudera.com> wrote:

> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why are
> my
> > tags duplicated while the content they wrap around i.e.my StringBuilder sb
> > is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n"
> ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value….
> >
> >                 …..
> >
> >                 ……
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> subject to
> > copyright and may be privileged. Any unauthorized use, copying or
> disclosure
> > is prohibited. If you are not the intended recipient, please delete and
> > contact the sender immediately. Please consider the environment before
> > printing this e-mail. AVIS : le présent courriel et toute pièce jointe
> qui
> > l'accompagne sont confidentiels, protégés par le droit d'auteur et
> peuvent
> > être couverts par le secret professionnel. Toute utilisation, copie ou
> > divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire
> > prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
>



-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
And a simple way to do that is actually writing a unit test, with MRunit
for exemple.

A little sample for a a full mapper-reducer test :

MapReduceDriver.newMapReduceDriver(new WordCountMapper(),new
WordCountReducer())
// given             .withInput(new LongWritable(1), new Text("word1 word2
word2 word1"))//
// then             .withOutput(new Text("word1"), new
LongWritable(2))//
.withOutput(new Text("word2"), new LongWritable(2))//
// when             .runTest();

Of course, there is also a MapDriver and a ReduceDriver. And
MRunitsupports both mapred and mapreduce packages.
So you should be able to apply it to your project.

Regards

Bertrand

On Tue, Oct 2, 2012 at 4:03 PM, Harsh J <ha...@cloudera.com> wrote:

> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why are
> my
> > tags duplicated while the content they wrap around i.e.my StringBuilder sb
> > is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n"
> ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value….
> >
> >                 …..
> >
> >                 ……
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> subject to
> > copyright and may be privileged. Any unauthorized use, copying or
> disclosure
> > is prohibited. If you are not the intended recipient, please delete and
> > contact the sender immediately. Please consider the environment before
> > printing this e-mail. AVIS : le présent courriel et toute pièce jointe
> qui
> > l'accompagne sont confidentiels, protégés par le droit d'auteur et
> peuvent
> > être couverts par le secret professionnel. Toute utilisation, copie ou
> > divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire
> > prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
>



-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
And a simple way to do that is actually writing a unit test, with MRunit
for exemple.

A little sample for a a full mapper-reducer test :

MapReduceDriver.newMapReduceDriver(new WordCountMapper(),new
WordCountReducer())
// given             .withInput(new LongWritable(1), new Text("word1 word2
word2 word1"))//
// then             .withOutput(new Text("word1"), new
LongWritable(2))//
.withOutput(new Text("word2"), new LongWritable(2))//
// when             .runTest();

Of course, there is also a MapDriver and a ReduceDriver. And
MRunitsupports both mapred and mapreduce packages.
So you should be able to apply it to your project.

Regards

Bertrand

On Tue, Oct 2, 2012 at 4:03 PM, Harsh J <ha...@cloudera.com> wrote:

> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why are
> my
> > tags duplicated while the content they wrap around i.e.my StringBuilder sb
> > is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n"
> ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value….
> >
> >                 …..
> >
> >                 ……
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> subject to
> > copyright and may be privileged. Any unauthorized use, copying or
> disclosure
> > is prohibited. If you are not the intended recipient, please delete and
> > contact the sender immediately. Please consider the environment before
> > printing this e-mail. AVIS : le présent courriel et toute pièce jointe
> qui
> > l'accompagne sont confidentiels, protégés par le droit d'auteur et
> peuvent
> > être couverts par le secret professionnel. Toute utilisation, copie ou
> > divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire
> > prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
>



-- 
Bertrand Dechoux

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

RE: puzzled at the output

Posted by "Kartashov, Andy" <An...@mpac.ca>.
I want:

Key  <tag>
          Value1
          Value2
        </tag>

I get double tags:
Key  <tag><tag>
          Value1
          Value2
        </tag></tag>

Here is my last proposition that also failed in Reduce.

...
public void reduce (.....
....
StringBuilder sb = new StringBuilder();
while (values.hasNext()){
     sb.append(values.next().toString());
    }

output.collect(key, new Text("\n<tag>"+sb.toString()+"</tag>" ));

Kind regards,








-----Original Message-----
From: Harsh J [mailto:harsh@cloudera.com]
Sent: Tuesday, October 02, 2012 10:03 AM
To: user@hadoop.apache.org
Subject: Re: puzzled at the output

Hi,

Could you clarify your post to show what you expect your code to have actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why
> are my tags duplicated while the content they wrap around i.e.my
> StringBuilder sb is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new
> Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value....
>
>                 .....
>
>                 ......
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential,
> subject to copyright and may be privileged. Any unauthorized use,
> copying or disclosure is prohibited. If you are not the intended
> recipient, please delete and contact the sender immediately. Please
> consider the environment before printing this e-mail. AVIS : le
> présent courriel et toute pièce jointe qui l'accompagne sont
> confidentiels, protégés par le droit d'auteur et peuvent être couverts
> par le secret professionnel. Toute utilisation, copie ou divulgation
> non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



--
Harsh J
NOTICE: This e-mail message and any attachments are confidential, subject to copyright and may be privileged. Any unauthorized use, copying or disclosure is prohibited. If you are not the intended recipient, please delete and contact the sender immediately. Please consider the environment before printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent être couverts par le secret professionnel. Toute utilisation, copie ou divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur. Veuillez penser à l'environnement avant d'imprimer le présent courriel

Re: puzzled at the output

Posted by Bertrand Dechoux <de...@gmail.com>.
And a simple way to do that is actually writing a unit test, with MRunit
for exemple.

A little sample for a a full mapper-reducer test :

MapReduceDriver.newMapReduceDriver(new WordCountMapper(),new
WordCountReducer())
// given             .withInput(new LongWritable(1), new Text("word1 word2
word2 word1"))//
// then             .withOutput(new Text("word1"), new
LongWritable(2))//
.withOutput(new Text("word2"), new LongWritable(2))//
// when             .runTest();

Of course, there is also a MapDriver and a ReduceDriver. And
MRunitsupports both mapred and mapreduce packages.
So you should be able to apply it to your project.

Regards

Bertrand

On Tue, Oct 2, 2012 at 4:03 PM, Harsh J <ha...@cloudera.com> wrote:

> Hi,
>
> Could you clarify your post to show what you expect your code to have
> actually printed and what it has printed?
>
> On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca>
> wrote:
> > Guys, have been stretching my head for the past couple of days.  Why are
> my
> > tags duplicated while the content they wrap around i.e.my StringBuilder sb
> > is not?
> >
> >
> >
> >
> >
> > My Reduce code is:
> >
> > while (values.hasNext()){
> >
> >     sb.append(values.next().toString());
> >
> >    }
> >
> >     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n"
> ));
> >
> >
> >
> > The out put:
> >
> > 2459
> >
> > <aaa>
> >
> >
> >
> > <aaa>
> >
> >         <value….
> >
> >                 …..
> >
> >                 ……
> >
> > </bbbb>
> >
> >
> >
> > </bbbb>
> >
> >
> >
> > NOTICE: This e-mail message and any attachments are confidential,
> subject to
> > copyright and may be privileged. Any unauthorized use, copying or
> disclosure
> > is prohibited. If you are not the intended recipient, please delete and
> > contact the sender immediately. Please consider the environment before
> > printing this e-mail. AVIS : le présent courriel et toute pièce jointe
> qui
> > l'accompagne sont confidentiels, protégés par le droit d'auteur et
> peuvent
> > être couverts par le secret professionnel. Toute utilisation, copie ou
> > divulgation non autorisée est interdite. Si vous n'êtes pas le
> destinataire
> > prévu de ce courriel, supprimez-le et contactez immédiatement
> l'expéditeur.
> > Veuillez penser à l'environnement avant d'imprimer le présent courriel
>
>
>
> --
> Harsh J
>



-- 
Bertrand Dechoux

Re: puzzled at the output

Posted by Harsh J <ha...@cloudera.com>.
Hi,

Could you clarify your post to show what you expect your code to have
actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why are my
> tags duplicated while the content they wrap around i.e.my  StringBuilder sb
> is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value….
>
>                 …..
>
>                 ……
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential, subject to
> copyright and may be privileged. Any unauthorized use, copying or disclosure
> is prohibited. If you are not the intended recipient, please delete and
> contact the sender immediately. Please consider the environment before
> printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui
> l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent
> être couverts par le secret professionnel. Toute utilisation, copie ou
> divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire
> prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



-- 
Harsh J

Re: puzzled at the output

Posted by Harsh J <ha...@cloudera.com>.
Hi,

Could you clarify your post to show what you expect your code to have
actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why are my
> tags duplicated while the content they wrap around i.e.my  StringBuilder sb
> is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value….
>
>                 …..
>
>                 ……
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential, subject to
> copyright and may be privileged. Any unauthorized use, copying or disclosure
> is prohibited. If you are not the intended recipient, please delete and
> contact the sender immediately. Please consider the environment before
> printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui
> l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent
> être couverts par le secret professionnel. Toute utilisation, copie ou
> divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire
> prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



-- 
Harsh J

Re: puzzled at the output

Posted by Harsh J <ha...@cloudera.com>.
Hi,

Could you clarify your post to show what you expect your code to have
actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why are my
> tags duplicated while the content they wrap around i.e.my  StringBuilder sb
> is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value….
>
>                 …..
>
>                 ……
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential, subject to
> copyright and may be privileged. Any unauthorized use, copying or disclosure
> is prohibited. If you are not the intended recipient, please delete and
> contact the sender immediately. Please consider the environment before
> printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui
> l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent
> être couverts par le secret professionnel. Toute utilisation, copie ou
> divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire
> prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



-- 
Harsh J

Re: puzzled at the output

Posted by Harsh J <ha...@cloudera.com>.
Hi,

Could you clarify your post to show what you expect your code to have
actually printed and what it has printed?

On Tue, Oct 2, 2012 at 7:01 PM, Kartashov, Andy <An...@mpac.ca> wrote:
> Guys, have been stretching my head for the past couple of days.  Why are my
> tags duplicated while the content they wrap around i.e.my  StringBuilder sb
> is not?
>
>
>
>
>
> My Reduce code is:
>
> while (values.hasNext()){
>
>     sb.append(values.next().toString());
>
>    }
>
>     output.collect(key,new Text("\n<aaa>\n"+sb.toString()+"\n</bbbb>\n" ));
>
>
>
> The out put:
>
> 2459
>
> <aaa>
>
>
>
> <aaa>
>
>         <value….
>
>                 …..
>
>                 ……
>
> </bbbb>
>
>
>
> </bbbb>
>
>
>
> NOTICE: This e-mail message and any attachments are confidential, subject to
> copyright and may be privileged. Any unauthorized use, copying or disclosure
> is prohibited. If you are not the intended recipient, please delete and
> contact the sender immediately. Please consider the environment before
> printing this e-mail. AVIS : le présent courriel et toute pièce jointe qui
> l'accompagne sont confidentiels, protégés par le droit d'auteur et peuvent
> être couverts par le secret professionnel. Toute utilisation, copie ou
> divulgation non autorisée est interdite. Si vous n'êtes pas le destinataire
> prévu de ce courriel, supprimez-le et contactez immédiatement l'expéditeur.
> Veuillez penser à l'environnement avant d'imprimer le présent courriel



-- 
Harsh J