[ 
https://issues.apache.org/jira/browse/PIG-5351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16559673#comment-16559673
 ] 

Nandor Kollar commented on PIG-5351:
------------------------------------

[~atul.raut] could you please use users (u...@pig.apache.org) mail list to ask 
questions about Pig. Jira should be used only to raise bug reports/real feature 
requests for Pig.

As of your question, you can interact with via it's CLI, it is not a service 
(like Hive), as far as I know there's no way to run a Pig "server" remotely, it 
doesn't expose any remote interface, where you can and submit scripts against 
it. The code you mention starts Pig locally, and interacts with remote HDFS and 
Mapreduce.

> How to execute pig script from java
> -----------------------------------
>
>                 Key: PIG-5351
>                 URL: https://issues.apache.org/jira/browse/PIG-5351
>             Project: Pig
>          Issue Type: Wish
>            Reporter: Atul Raut
>            Priority: Minor
>
> How to execute pig script from java class.
> I need to submit Pig script from my java application to the Pig server (This 
> may be on any remote location) and that Pig server will execute that script 
> and return the result to my java application.
>  
> Following is my source,
> public static void main(String[] args) throws Exception {
>  System.setProperty("hadoop.home.dir", 
> "/Pig/hadoop-common-2.2.0-bin-master/");
>  
>  Properties props = new Properties();
>  props.setProperty("fs.default.name", "hdfs://192.168.102.179:8020");
>  props.setProperty("mapred.job.tracker", "192.168.102.179:8021");
>  props.setProperty("pig.use.overriden.hadoop.configs", "true");
> PigServer pig = new PigServer(ExecType.MAPREDUCE, props); 
>  pig.debugOn();
> pig.registerScript("A = LOAD '/apps/employee/sample.txt' USING 
> PigStorage();");
> }
>  
> Thank you in advanced for your support.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to