GreedyInputContainers.sql 454 B

12345678910111213141516171819
  1. --sanitizer ignore memory
  2. /* syntax version 1 */
  3. $s = @@
  4. def list_func(lst):
  5. return lst.count(1)
  6. list_func._yql_lazy_input = False
  7. @@;
  8. $u = Python3::list_func(Callable<(List<Int32>)->Int32>, $s);
  9. select $u(AsList(1,2,3));
  10. $s = @@
  11. def dict_func(dict):
  12. return list(dict.values()).count(b"b")
  13. dict_func._yql_lazy_input = False
  14. @@;
  15. $v = Python3::dict_func(Callable<(Dict<Int32, String>)->Int32>, $s);
  16. select $v(AsDict(AsTuple(1,"a"),AsTuple(2,"b")));