Pig ERROR 2998:未处理的内部错误.静态(错误名称:com/company/Static) [英] Pig ERROR 2998: Unhandled internal error. Static (wrong name: com/company/Static)
问题描述
我有一个 Pig 脚本,它返回一个常量字符串值.当我尝试使用以下命令运行脚本时,出现 Pig ERROR 2998:
I have a Pig script that returns a constant string value. When I try to run the script with the following command, I get a Pig ERROR 2998:
pig -Dpig.additional.jars=Static.jar -f script.pig -l /dev/null -x local
script.pig
loaded = LOAD 'data/' USING com.twitter.elephantbird.pig.store.LzoPigStorage() AS (request);
script.pig
loaded = LOAD 'data/' USING com.twitter.elephantbird.pig.store.LzoPigStorage() AS (request);
加载 = 样本加载 0.00001;
loaded = SAMPLE loaded 0.00001;
size = FOREACH 加载 GENERATE Static(request);
sized = FOREACH loaded GENERATE Static(request);
转储大小;
导致错误的原因是什么?
What's causing the error?
推荐答案
这似乎是一个没有人发现的 java.lang.NoClassDefFoundError
错误.错误本身发生是因为 jvm 找不到您请求的类.
It appears to be a java.lang.NoClassDefFoundError
error that nobody is catching. The error itself occurs because the jvm cannot find the class you requested.
具体来说,您似乎缺少 jar 中所需的目录结构.com.company.Static
(即 Static.class
文件)应位于 jar 中的 com/company
目录下.查看其他SO问题了解更多详情.
Specifically, you seem to be missing the required directory structure in the jar. com.company.Static
(i.e., the Static.class
file) should be located under the com/company
directory in the jar. See this other SO question for more details.
要快速修复,请查看 How 上的这个问题创建一个具有包结构的jar文件.
For a quick fix, take a look at this question on How to create a jar file with package structure.
这篇关于Pig ERROR 2998:未处理的内部错误.静态(错误名称:com/company/Static)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!