1

我正在尝试编写一个猪脚本。我让它在本地模式下成功运行,但是当我在伪分布式模式下启动猪时出错。这是脚本:

register 'myfolder/target/myfunc-with-dependencies.jar';
SET mapred.cache.files /tmp/scripts#scripts,/tmp/my_rules#my_rules;
SET mapred.create.symlink yes;

%default INPUT 'test.seq'
%default OUTPUT 'final.out'
%default TIMEOUT_MS '180000'
%default USE_DEVSHM 'true'

data = load '$INPUT' using com.pack.loaders.MyTextLoader('$TIMEOUT_MS');
STORE data INTO '$OUTPUT'

我收到以下错误:

2013-09-03 08:08:44,314 [main] WARN org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Ooops! Some job has failed! Specify -stop_on_failure if you want Pig to stop immediately on failure.
2013-09-03 08:08:44,316 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - job job_201309030605_0019 has failed! Stop running all dependent jobs
2013-09-03 08:08:44,319 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - 100% complete
2013-09-03 08:08:44,323 [main] ERROR org.apache.pig.tools.pigstats.PigStatsUtil - 1 map reduce job(s) failed!
2013-09-03 08:08:44,323 [main] WARN  org.apache.pig.tools.pigstats.ScriptState - unable to read pigs manifest file
2013-09-03 08:08:44,325 [main] INFO  org.apache.pig.tools.pigstats.SimplePigStats - Script Statistics: 

HadoopVersion   PigVersion  UserId  StartedAt   FinishedAt  Features
1.2.1       vmuser  2013-09-03 08:07:57 2013-09-03 08:08:44 UNKNOWN

Failed!

Failed Jobs:
JobId   Alias   Feature Message Outputs
job_201309030605_0019   data    MAP_ONLY    Message: Job failed! Error - JobCleanup Task Failure, Task: task_201309030605_0019_m_000001 hdfs://localhost:9000/user/vmuser/final.out,

Input(s):
Failed to read data from "hdfs://localhost:9000/user/vmuser/test.seq"

Output(s):
Failed to produce result in "hdfs://localhost:9000/user/vmuser/final.out"

该文件存在于 HDFS 上,另一个没有注册任何 jar 并使用PigStorage()而不是 UDF 的脚本工作正常。有没有其他方法可以注册 jar 并调用 UDF?

pig日志文件的内容是:

猪堆栈跟踪

ERROR 2244: Job failed, hadoop does not return any error message

org.apache.pig.backend.executionengine.ExecException: ERROR 2244: Job failed, hadoop does not return any error message
    at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:145)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:198)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:170)
    at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
    at org.apache.pig.Main.run(Main.java:604)
    at org.apache.pig.Main.main(Main.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
4

1 回答 1

0

可能这个链接可以帮助你: 通过pig中使用的java jar调用程序, 并提供你的jar文件的完整路径,以便hadoop可以从任何地方找到它。

于 2013-09-04T12:23:49.843 回答