这可能是一个非常基本的问题,我是猪和Python领域的新手。 我正在尝试从pigutil导入outputSchema。在
outputSchema在python UDF中的用法如下:
@outputSchema('HistorySchema:bag{t:(SomeKey:int,ScdColumnNew:chararray,ScdColumnOld:int, activeFlag:chararray, EndDate:int, ChangeDate:int)}')
我在尝试运行并检查Python命令行编辑器时遇到以下错误。在
^{pr2}$一旦使用语句导入
from pigutil import outputSchema
以下错误:-
ImportError: No module named org.apache.pig
我在这里试图实现的是编写一个UDF,它将从Pig中的一个tuple返回2个tuple。我尝试过使用两个不同的generate语句,然后对它们进行联合,但是它的性能很重,因此使用UDF。在
从pig_util import outputSchema
http://help.mortardata.com/technologies/pig/writing_python_udfs#toc_4UsingtheoutputSchemaDecoratorinPython
相关问题 更多 >
编程相关推荐