Grokbase Groups Pig user April 2013
FAQ
Hi,

I have just started learning about Pig, and i had a task of importing a
line from a text file as a bag in pig.

The contents of my file were:
{(2,3) (5,6,7,8)}
{(2,4) (5,7,8,9)}
{(1,3) (4,5,7,9)}
{(2,5) (7,9,1,1)}
{(2,3) (4,6,8,3)}


So, the command that is used to import this file as a bag was:

A = LOAD '<file_name>' USING PigStorage(' ') AS (B:Bag {(T: tuple(f1:int,
f2:int), F: tuple(f3:int, f4:int, f5:int, f6:int))});

When i do a DUMP A command, the result does not show any values.
A blank set of tuples are displayed.

I'm not sure if i'm doing something wrong ?
Any help would be greatly appreciated!

Thanks,
Sachin

Search Discussions

  • Centerqi hu at Apr 24, 2013 at 4:29 pm
    file_name is on hdfs?


    2013/4/24 Sachin Sudarshana <sachin.hadoop@gmail.com>
    Hi,

    I have just started learning about Pig, and i had a task of importing a
    line from a text file as a bag in pig.

    The contents of my file were:
    {(2,3) (5,6,7,8)}
    {(2,4) (5,7,8,9)}
    {(1,3) (4,5,7,9)}
    {(2,5) (7,9,1,1)}
    {(2,3) (4,6,8,3)}


    So, the command that is used to import this file as a bag was:

    A = LOAD '<file_name>' USING PigStorage(' ') AS (B:Bag {(T: tuple(f1:int,
    f2:int), F: tuple(f3:int, f4:int, f5:int, f6:int))});

    When i do a DUMP A command, the result does not show any values.
    A blank set of tuples are displayed.

    I'm not sure if i'm doing something wrong ?
    Any help would be greatly appreciated!

    Thanks,
    Sachin


    --
    centerqi@gmail.com|齐忠
  • Sachin Sudarshana at Apr 25, 2013 at 6:22 am
    Hi,

    Yes the file is on HDFS..

    Thanks,
    sachin

    On Wed, Apr 24, 2013 at 9:58 PM, centerqi hu wrote:

    file_name is on hdfs?


    2013/4/24 Sachin Sudarshana <sachin.hadoop@gmail.com>
    Hi,

    I have just started learning about Pig, and i had a task of importing a
    line from a text file as a bag in pig.

    The contents of my file were:
    {(2,3) (5,6,7,8)}
    {(2,4) (5,7,8,9)}
    {(1,3) (4,5,7,9)}
    {(2,5) (7,9,1,1)}
    {(2,3) (4,6,8,3)}


    So, the command that is used to import this file as a bag was:

    A = LOAD '<file_name>' USING PigStorage(' ') AS (B:Bag {(T: tuple(f1:int,
    f2:int), F: tuple(f3:int, f4:int, f5:int, f6:int))});

    When i do a DUMP A command, the result does not show any values.
    A blank set of tuples are displayed.

    I'm not sure if i'm doing something wrong ?
    Any help would be greatly appreciated!

    Thanks,
    Sachin


    --
    centerqi@gmail.com|齐忠

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedApr 24, '13 at 10:17a
activeApr 25, '13 at 6:22a
posts3
users2
websitepig.apache.org

2 users in discussion

Sachin Sudarshana: 2 posts Centerqi hu: 1 post

People

Translate

site design / logo © 2021 Grokbase