question about syntax for nested evaluations using bincond

2013-07-05 Thread mark meyer
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

Re: ClassCastException with bincond operator

2013-05-05 Thread Johnny Zhang
Hi, Peter: http://pig.apache.org/docs/r0.11.1/basic.html#cast cast from String to long is not supported. Johnny On Fri, May 3, 2013 at 12:01 PM, Peter Connolly ptr...@yahoo.com wrote: I'm new to pig and I'm getting a ClassCastException when I try to run the following script in pig 0.11.1:

ClassCastException with bincond operator

2013-05-03 Thread Peter Connolly
I'm new to pig and I'm getting a ClassCastException when I try to run the following script in pig 0.11.1: A = LOAD 'test.log' AS (timestamp:long, pk_id:int, array_field:chararray, fk_id:int); B = FOREACH A GENERATE timestamp, pk_id, FLATTEN(STRSPLIT(array_field,',')) AS (field1:chararray,

Re: BinCond is not working

2013-04-29 Thread Miguel Angel Martin junquera
register /path_to_yourjars/piggybank.jar*;* define BinCond org.apache.pig.piggybank.evaluation.decode.BinCond(); 2013/4/27 soniya B soniya.bigd...@gmail.com Hi Russell, I have already executed below one but no luck register piggybank.jar *define BinCond

BinCond

2013-04-27 Thread soniya B
Hi, Anyone can explain me about use of BinCond function with an example? I am trying a lot but didn't work it. Regards Soniya

Re: BinCond

2013-04-27 Thread Mohammad Tariq
)}) (10,3,{(2,3),(4,6)}) (10,6,{(2,3),(4,6),(5,7)}) *In this example the modulo operator is used with fields f1 and f2.* X = FOREACH A GENERATE f1, f2, f1%f2; DUMP X; (10,1,0) (10,3,1) (10,6,4) *In this example the bincond operator is used with fields f2 and B. The condition is f2 equals 1

Re: BinCond

2013-04-27 Thread soniya B
)}) *In this example the modulo operator is used with fields f1 and f2.* X = FOREACH A GENERATE f1, f2, f1%f2; DUMP X; (10,1,0) (10,3,1) (10,6,4) *In this example the bincond operator is used with fields f2 and B. The condition is f2 equals 1; if the condition is true, return 1

BinCond is not working

2013-04-26 Thread soniya B
Hi Friends, I have registered piggy bank.I tried to to use BinCond funcation but it is not working . Any one can suggest why it not working?

Re: BinCond is not working

2013-04-26 Thread Russell Jurney
Paste code? On Apr 26, 2013 10:05 AM, soniya B soniya.bigd...@gmail.com wrote: Hi Friends, I have registered piggy bank.I tried to to use BinCond funcation but it is not working . Any one can suggest why it not working?

Re: BinCond is not working

2013-04-26 Thread soniya B
statement into PIG script and i have written script below A = Load 'PEP_ACC_Details' ; B= foreach A generate SUP1,DEP_NO,BinCond(SVT1,'Y','A',SVT2,'Y','B',SVT3,'Y','C',SVT4,'I','D',SVT5,'J','E','F'); but it is not working. Could you please verify and let me know.. Yours Soniya On Fri, Apr 26, 2013

Re: BinCond is not working

2013-04-26 Thread Russell Jurney
= 'Y' THEN 'C' WHEN SVT4= 'I' THEN 'D' WHEN SVT5 = 'J' THEN 'E' ELSE 'F' END FROM PEP_ACC_Details I am trying to convert above statement into PIG script and i have written script below A = Load 'PEP_ACC_Details' ; B= foreach A generate SUP1,DEP_NO,BinCond(SVT1,'Y','A',SVT2,'Y','B',SVT3,'Y

Re: BinCond is not working

2013-04-26 Thread Russell Jurney
Did you do this first? register piggybank.jar *define BinCond org.apache.pig.piggybank.evaluation.decode.BinCond();* Russell Jurney http://datasyndrome.com On Apr 26, 2013, at 11:43 AM, soniya B soniya.bigd...@gmail.com wrote: Hi Russell, Actually i am trying to convert sql queries to PIG

Re: BinCond is not working

2013-04-26 Thread soniya B
Hi Russell, I have already executed below one but no luck register piggybank.jar *define BinCond org.apache.pig.piggybank.evaluation.decode.BinCond();* I am getting syntax error as mismatched input '(' expecting SEMI_COLON On Sat, Apr 27, 2013 at 12:44 AM, Russell Jurney russell.jur

Re: BinCond is not working

2013-04-26 Thread soniya B
Hi Russell, I have already executed below one but no luck register piggybank.jar *define BinCond org.apache.pig.piggybank.evaluation.decode.BinCond();* I am getting syntax error as mismatched input '(' expecting SEMI_COLON Is the syntax correct that i have written? Thanks Soniya On Sat, Apr

Re: Issues with Bincond

2012-08-22 Thread Cheolsoo Park
with bincond in pig 11. Sample input: 1234 0 1234 Sample pig script: a = LOAD 'input.txt' as (col1:int); b = FOREACH a GENERATE col1, (col1 == null ? 'null' : 'not-null') as col2; dump b; Output: (1234,) (0,) (1234,) Certainly not what you expect to see... I expected to see

Re: Issues with Bincond

2012-08-22 Thread Alex Rovner
/docs/r0.10.0/basic.html#nulls Thanks, Cheolsoo On Wed, Aug 22, 2012 at 11:28 AM, Alex Rovner alexrov...@gmail.com wrote: I am having trouble with bincond in pig 11. Sample input: 1234 0 1234 Sample pig script: a = LOAD 'input.txt' as (col1:int); b = FOREACH a GENERATE

Re: Issues with Bincond

2012-08-22 Thread Alan Gates
/docs/r0.10.0/basic.html#nulls Thanks, Cheolsoo On Wed, Aug 22, 2012 at 11:28 AM, Alex Rovner alexrov...@gmail.com wrote: I am having trouble with bincond in pig 11. Sample input: 1234 0 1234 Sample pig script: a = LOAD 'input.txt' as (col1:int); b = FOREACH a GENERATE col1