yield_on.sql 474 B

1234567891011121314151617181920
  1. /* syntax version 1 */
  2. /* postgres can not */
  3. USE plato;
  4. pragma config.flags("UdfSupportsYield","true");
  5. $s = @@
  6. def f(input, a):
  7. for x in input:
  8. yield x
  9. @@;
  10. $f = Python::f(Callable<(Stream<Struct<key:String,subkey:String,value:String>>,Int32)->Stream<Struct<key:String,subkey:String,value:String>>>, $s);
  11. SELECT * FROM (
  12. PROCESS Input using $f(TableRows(), 1)
  13. UNION ALL
  14. PROCESS Input using $f(TableRows(), 2)
  15. ) AS x
  16. ORDER BY key, subkey, value
  17. ;