aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/hor_join/yield_on.sql
blob: 62efa85744111bc29f8e49ee204cd8ddd5175ea0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* syntax version 1 */
/* postgres can not */
USE plato;
pragma config.flags("UdfSupportsYield","true");

$s = @@
def f(input, a):
    for x in input:
        yield x
@@;

$f = Python::f(Callable<(Stream<Struct<key:String,subkey:String,value:String>>,Int32)->Stream<Struct<key:String,subkey:String,value:String>>>, $s);

SELECT * FROM (
    PROCESS Input using $f(TableRows(), 1)
    UNION ALL
    PROCESS Input using $f(TableRows(), 2)
) AS x
ORDER BY key, subkey, value
;