You can do it the way Tom suggests. Also take a look at PigServer / PigRunner
https://wiki.apache.org/pig/EmbeddedPig https://pig.apache.org/docs/r0.11.0/api/org/apache/pig/PigServer.html Or use Java / Python and call the shell. Look at importing subprocess in Python or Runtime in Java. Will Duckworth Senior Vice President, Software Engineering | comScore, Inc.(NASDAQ:SCOR) o +1 (703) 438-2108 | m +1 (301) 606-2977 | mailto:[email protected] ..................................................................................................... comScore Media Metrix(r) Multi-Platform: Audience Analytics for the Brave New Digital World www.comscore.com/multiplatform -----Original Message----- From: Shahab Yunus [mailto:[email protected]] Sent: Tuesday, May 07, 2013 10:01 AM To: [email protected] Subject: Re: does pig support loop and branching now? Nevermind Jonathan, if you also meant the same thing what Tom Wheeler just posted. Thanks :) On Tue, May 7, 2013 at 9:59 AM, Tom Wheeler <[email protected]> wrote: > Neither are supported directly in Pig Latin, but it is possible to > embed Pig in another language such as Java or Python to achieve these: > > http://ofps.oreilly.com/titles/9781449302641/embedding.html > > On Tue, May 7, 2013 at 6:13 AM, yonghu <[email protected]> wrote: > > > Dear all, > > > > I wonder if someone can tell me if the current version of pig > > support > loop > > and branching? > > > > regards! > > > > Yong > > > > > > -- > Tom Wheeler > http://www.tomwheeler.com/ >
