-1

这可能是一个非常基本的问题,我是猪和蟒蛇领域的新手。我正在尝试从 pigutil 导入 o​​utputSchema。

outputSchema 在 python UDF 中使用如下:-

 @outputSchema('HistorySchema:bag{t:(SomeKey:int,ScdColumnNew:chararray,ScdColumnOld:int, activeFlag:chararray, EndDate:int, ChangeDate:int)}')

我在尝试运行和检查Python 命令行编辑器时遇到错误。

NameError: name 'outputSchema' is not defined

使用语句导入后

from pigutil import outputSchema

出现以下错误:-

ImportError: No module named org.apache.pig

我在这里想要实现的是编写一个 UDF,它将从 Pig 中的单个元组返回 2 个元组。我已经尝试过使用两个不同的生成语句的方法,然后将两者结合起来,但它的性能很重,因此选择了 UDF。

4

1 回答 1

0

从 pig_util 导入 o​​utputSchema

http://help.mortardata.com/technologies/pig/writing_python_udfs#toc_4UsingtheoutputSchemaDecoratorinPython

于 2016-06-15T22:42:30.693 回答