Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Inserting a row from a file as a bag


Copy link to this message
-
Re: Inserting a row from a file as a bag
file_name is on hdfs?
2013/4/24 Sachin Sudarshana <[EMAIL PROTECTED]>

> 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
>

--
[EMAIL PROTECTED]|齐忠
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB