gpt4 book ai didi

java - 如何使用eclipse编写并执行PIG Latin

转载 作者:太空宇宙 更新时间:2023-11-04 12:49:51 25 4
gpt4 key购买 nike

我想在 Windows 中从 eclipse 执行 Pig 脚本。我已关注this link 。但它不起作用。是否需要任何插件才能做到这一点?或者只有 pig.jar 就可以了?

最佳答案

试试这个,有效

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);

关于java - 如何使用eclipse编写并执行PIG Latin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35934953/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com