Thanks Bill.

On Wed, May 9, 2012 at 4:02 AM, Bill Graham <[email protected]> wrote:

> You could write a UDF that take the tuple and does string munging to
> produce the XML for a given record. Each <stud> element would be on a
> single line if that's ok.
>
> This is approach is ugly in that you're manually building XML strings in
> Java, but it's quick and easy to implement.
>
>
> On Tue, May 8, 2012 at 10:53 AM, DIPESH KUMAR SINGH
> <[email protected]>wrote:
>
> > Hi,
> >
> > I have data in a file which has schema, say like this: (stud_id, Physics,
> > Chemistry, Bio, CS)
> >
> > I need to generate an output which should contain (stud_id , xml_payload)
> > for each record in my relation.
> >
> > The type of dynamic xml i need to generate is like this:
> >
> > <stud xmlns: www.w3.org .... ... >
> >   <stud_id> A-12 </stud_id>
> >   <subjects>
> >         <marks>
> >               <phy> 98 </phy>
> >               <chem>96 </chem>
> >        </marks>
> >   </subjects>
> > </stud>
> >
> > <stud xmlns: www.w3.org .... >
> >   <stud_id> A-102 </stud_id>
> >   <subjects>
> >         <marks>
> >               <phy> 98 </phy>
> >               <chem>96 </chem>
> >               <CS> 100</CS>
> >        </marks>
> >   </subjects>
> > </stud>
> >
> > Any suggestions on how to proceed on this? I am bit new to pig.
> >
> > Thanks & Regards,
> >
> > Dipesh
> >
>
>
>
> --
> *Note that I'm no longer using my Yahoo! email address. Please email me at
> [email protected] going forward.*
>



-- 
Dipesh Kr. Singh

Reply via email to