You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by prasenjit mukherjee <pr...@gmail.com> on 2010/05/26 19:48:08 UTC

how to load this relation

I am tryign this load statement to load the following data : r = load
'tmp.dat' AS (f1:int, f2:int, B: bag { T: tuple (g1:int, g2:int) });

1,2,{(3,4),(5,6)}
1,2,{(3,4),(5,6),(10,12)}
7,8,{(3,4)}

But it is not working. Any help ?

-Thanks,
Prasen

Re: how to load this relation

Posted by prasenjit mukherjee <pm...@quattrowireless.com>.
thanks it worked.

On Thu, May 27, 2010 at 3:51 AM, Akira Kitada <ak...@gmail.com> wrote:
> PigStorage, the default function for the LOAD operator, uses a tab
> character ('\t') as the default field delimiter.
>
>  http://hadoop.apache.org/pig/docs/r0.7.0/piglatin_ref2.html#PigStorage
>
> So, if tmp.dat was tab separated as:
>
> 1       2       {(3,4),(5,6)}
> 1       2       {(3,4),(5,6),(10,12)}
> 7       8       {(3,4)}
>
> your load  operator should just work.
>
> Thanks,
> Akira
> On Thu, May 27, 2010 at 2:48 AM, prasenjit mukherjee
> <pr...@gmail.com> wrote:
>> I am tryign this load statement to load the following data : r = load
>> 'tmp.dat' AS (f1:int, f2:int, B: bag { T: tuple (g1:int, g2:int) });
>>
>> 1,2,{(3,4),(5,6)}
>> 1,2,{(3,4),(5,6),(10,12)}
>> 7,8,{(3,4)}
>>
>> But it is not working. Any help ?
>>
>> -Thanks,
>> Prasen
>>
>

Re: how to load this relation

Posted by Akira Kitada <ak...@gmail.com>.
PigStorage, the default function for the LOAD operator, uses a tab
character ('\t') as the default field delimiter.

  http://hadoop.apache.org/pig/docs/r0.7.0/piglatin_ref2.html#PigStorage

So, if tmp.dat was tab separated as:

1	2	{(3,4),(5,6)}
1	2	{(3,4),(5,6),(10,12)}
7	8	{(3,4)}

your load  operator should just work.

Thanks,
Akira
On Thu, May 27, 2010 at 2:48 AM, prasenjit mukherjee
<pr...@gmail.com> wrote:
> I am tryign this load statement to load the following data : r = load
> 'tmp.dat' AS (f1:int, f2:int, B: bag { T: tuple (g1:int, g2:int) });
>
> 1,2,{(3,4),(5,6)}
> 1,2,{(3,4),(5,6),(10,12)}
> 7,8,{(3,4)}
>
> But it is not working. Any help ?
>
> -Thanks,
> Prasen
>