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 >> nested Tuple(Tuple)


Copy link to this message
-
Re: nested Tuple(Tuple)
Yeah, says so in the manual -
"A single element enclosed in parens ( ) like (5) is not considered to be a
tuple but rather an arithmetic operator."
http://pig.apache.org/docs/r0.10.0/basic.html#type-construction

We can always use TOTUPLE. This should work:
a = load 'a' as (x,y);

b = foreach a generate TOTUPLE(TOTUPLE(x));

dump b;

Regards,
Abhinav

On 29 June 2012 01:34, Yang <[EMAIL PROTECTED]> wrote:

> it seems that (at least with 0.10.0 ) I can generate a nested tuple inside
> a bag.
>
> but if I want to insert a tuple directly under a tuple, they seem to merge
> together into one level directly.
>
> for example
>
> a = load 'a' as (x,y);
>
> b = foreach a generate ((x));
>
> dump b;
>
> the result is just a flat record, instead of nested tuple
>
>
>
> but generate {(x)} does work
>
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