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 >> how to address "nested structure" in PIG?


Copy link to this message
-
Re: how to address "nested structure" in PIG?
l found out, actually the original form works fine, i.e. "by value.seqNum
== 1". but the error I got was due to the fact that the first "load"
command actually fails to load anything, i.e.
b is empty, so there is no schema for b, then any field does not exist.
On Mon, Sep 30, 2013 at 5:59 PM, Yang <[EMAIL PROTECTED]> wrote:

> I have a dataset written in Avro format,
> I read it using
>
> b = load 'myfile' using AvroStorage();
>
> describe b;
>
> it shows the following schema:  it seems that at the root level, there are
> only 2 fields: key and value, the value for "value" field is actually a
>  record too.
>
>
> b: {key: (guid: chararray,sessionSkey: long),value: (guid:
> chararray,sessionSkey: long,seqNum: int,sessionStartDt: long)}
>
>
> my question is, how can I address the seqNum field under "value", so that
> I could so filtering like this:
>
> c = filter b by value.seqNum == 1 ;
>
> ?
>
> thanks
> Yang
>
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