我想在windows中从eclipse执行Pig脚本。我跟着this link。但它没有用。是否需要插件才能执行此操作?或者只有pig.jar
没问题?
答案 0 :(得分:0)
试试这个,它有效
Runtime runTime = Runtime.getRuntime();
String pigCommand = "pig -f "+pigPath+" //pigPath must be hdfs path.
Process proc = runTime.exec(pigCommand);
BufferedReader bri = new BufferedReader(new InputStreamReader(proc.getInputStream()));
BufferedReader bre = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
String line = "";
while ( (line = bri.readLine()) != null);
while ( (line = bre.readLine()) != null);