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 Plain View
Pig >> mail # user >> How to use tuples ?


+
praveenesh kumar 2012-02-02, 09:05
+
Daniel Dai 2012-02-02, 09:19
Copy link to this message
-
Re: How to use tuples ?
thanks Daniel,
so it means for all other complex datatypes, we need the file contents to
be in that format
like tuples in ( ), bag in { } , map in [ ]

On Thu, Feb 2, 2012 at 2:49 PM, Daniel Dai <[EMAIL PROTECTED]> wrote:

> Hi, Praveenesh,
> Your tmp.txt should be:
> (1,2,3,4)
> (2,3,4,5)
> (4,5,5,6)
>
> And you cannot use "," as a delimit for PigStorage, otherwise,
> PigStorage will split the line with comma first then parse the tuple.
>
> Daniel
>
> On Thu, Feb 2, 2012 at 1:05 AM, praveenesh kumar <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > I am trying to learn how can I store records in tuples ?
> >
> > Suppose I have a txt file
> >
> > $ cat tmp.txt
> >
> > 1,2,3,4
> > 2,3,4,5
> > 4,5,5,6
> >
> > I am doing this
> > $ pig > A = Load 'tmp.txt' using PigStorage(',') AS
> > (t:tuple(int:a,int:b,int:c,int:d));
> > $ pig > Dump A;
> > I am getting nothing in the output
> > ( )
> > ( )
> > ( )
> >
> > Can anyone help me understanding why its happening ?
> > Even if I don't use PigStorage nothing is coming.
> >
> > Thanks,
> > Praveenesh
>
+
praveenesh kumar 2012-02-02, 09:58
+
praveenesh kumar 2012-02-02, 10:09
+
praveenesh kumar 2012-02-02, 10:43
+
Daniel Dai 2012-02-06, 07:40
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