flatten_with_resource.sql 471 B

12345678910111213141516171819
  1. /* postgres can not */
  2. /* kikimr can not */
  3. /* syntax version 1 */
  4. $script = @@
  5. def save(item):
  6. return item
  7. def load(item):
  8. return item
  9. @@;
  10. $save = Python3::save(Callable<(String)->Resource<Python3>>, $script);
  11. $load = Python3::load(Callable<(Resource<Python3>)->String>, $script);
  12. $input = (
  13. SELECT key, AsList($save(value), $save(subkey)) AS resourceList FROM plato.Input
  14. );
  15. SELECT key, $load(resourceList) AS value FROM $input FLATTEN BY resourceList;