There is nothing directly in Pig, you have to embed it into another language. Please take a look at control structures:
http://pig.apache.org/docs/r0.11.1/cont.html -- Marco 2013/7/16 Bhavesh K Shah <[email protected]> > Hello All, > > I am newbie to Apache Pig and I am exploring it for my one of the use case. > Actually I am writing PIG Script and want to execute some set of > statements if one of the condition is satisfied. > I have set one variable to some value. I want to implement like below: > > if flag==0 then > A = LOAD 'file' using PigStorage() as (f1:int, ....); > B = ...; > C = ....; > else > again some Pig Latin statements > > Can I do this in PIG Script? If yes, then how can I do this? > > Also I came across conditional operator in Pig like (a == b ? c1 : c2);. > But How can I insert bulk of Pig Statements in between operator? > > > Thanks. > Bhavesh Shah > > **************************************Disclaimer****************************************** > This e-mail message and any attachments may contain confidential > information and is for the sole use of the intended recipient(s) only. Any > views or opinions presented or implied are solely those of the author and > do not necessarily represent the views of BitWise. If you are not the > intended recipient(s), you are hereby notified that disclosure, printing, > copying, forwarding, distribution, or the taking of any action whatsoever > in reliance on the contents of this electronic information is strictly > prohibited. If you have received this e-mail message in error, please > immediately notify the sender and delete the electronic message and any > attachments.BitWise does not accept liability for any virus introduced by > this e-mail or any attachments. > ******************************************************************************************** >
