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 >> question about syntax for nested evaluations using bincond


+
mark meyer 2013-07-05, 20:39
Copy link to this message
-
Re: question about syntax for nested evaluations using bincond
No, both are equally correct.  == has higher precedence than ?:

Alan.

On Jul 5, 2013, at 1:39 PM, mark meyer wrote:

> hello,
>
> i am new to pig and have a question regarding the syntax arrangement for nested evaluations using bincond.
>
> both of these seem to work and produce identical results.
>
> is one syntax "more" correct?
>
> C = foreach B generate
>        id,
>        name,
>        role,
>        ((location == 'P02' ? 'IL': (
>                (location == 'P06' ? 'FL': (
>                (location == 'P09' ? 'WI': (
>                (location == 'P11' ? 'CA': id)))))))) as location;
>
>
> C = foreach B generate
>        id,
>        name,
>        role,
>        ((location == 'P02') ? 'IL': (
>                (location == 'P06') ? 'FL': (
>                (location == 'P09') ? 'WI': (
>                (location == 'P11') ? 'CA': id)))) as location;
>
>
> thx
> mark
>
>    
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