小编use*_*334的帖子

如何:PIG中的Python UDF字典返回模式

使用Apache PIG时从Python UDF返回字典的输出模式是什么.

我有一本字典词典,如下所示:

dict = {x:{a:1,b:2,c:3}, y:{d:1,e:3,f:9}}
Run Code Online (Sandbox Code Playgroud)

我的输出架构看起来像

@outputSchema("m:map[im:map[X:float,Y:float]]") 
Run Code Online (Sandbox Code Playgroud)

**方括号,因为在Pig中我们使用[]作为此词典转换为的地图.

python schema dictionary user-defined-functions apache-pig

8
推荐指数
1
解决办法
1939
查看次数