pig-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <qwertyman...@gmail.com>
Subject Re: Call Pig from Java
Date Thu, 05 Aug 2010 04:02:40 GMT
Sorry, forgot the API link:
http://hadoop.apache.org/pig/docs/r0.7.0/api/org/apache/pig/PigServer.html

On Thu, Aug 5, 2010 at 9:31 AM, Harsh J <qwertymaniac@gmail.com> wrote:
> You need to use the class PigServer.
>
> PigServer pigServer = new PigServer("mapreduce"); // Or "local" for local mode
> pigServer.registerQuery("A = LOAD ...");
> (...) // Your statements here.
> pigServer.store("A", "filename");
>
> On Thu, Aug 5, 2010 at 9:26 AM, Wenhao Xu <xuwenhao2008@gmail.com> wrote:
>> Hi all,
>>   I am new to pig. I am wondering is there any recommended way to call Pig
>> code from Java?
>>   Is there any Java interface which can be called directly from Java and
>> makes them work smoothly? It seems each keyword (filter, group, cogrape,
>> generate) and data types in Pig can have a counterpart in Java by using
>> Class, interface and data type. Is these Java interface available to Java
>> programmers to use? If not, why not?
>>    Thanks very much for help!
>>
>> regards,
>> Wenhao
>>
>> --
>> ~_~
>>
>
>
>
> --
> Harsh J
> www.harshj.com
>



-- 
Harsh J
www.harshj.com

Mime
View raw message