1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
USE plato;
$a = (SELECT
skey,count(*) as cnt
FROM Input
GROUP BY Length(key) as skey);
$udfScript = @@
def f(input,x):
for i in list(input):
d = i.__dict__
d["pass"] = x
yield d
@@;
$udf = Python::f(@@
(Stream<Struct<skey:Uint32,cnt:Uint64>>,Int32)
->
Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
@@, $udfScript);
$udf2 = Python::f(@@
(Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>,Int32)
->
Stream<Struct<skey:Uint32,cnt:Uint64,pass:Int32>>
@@, $udfScript);
$b = (PROCESS $a USING $udf($ROWS,1));
PROCESS $b USING $udf2($ROWS,2);
|