yql-7324_duplicate_arg.sql 436 B

1234567891011121314151617181920212223
  1. /* postgres can not */
  2. /* syntax version 1 */
  3. USE plato;
  4. $to_int = ($x) -> { return cast($x as Int32) };
  5. $to_in_list = ($col) -> { return ListMap(String::SplitToList($col, ","), $to_int) };
  6. $input = (
  7. SELECT
  8. $to_in_list(key) AS event_ids,
  9. $to_in_list(subkey) AS test_ids
  10. FROM
  11. Input
  12. WHERE
  13. value = "aaa"
  14. );
  15. SELECT
  16. event_id,
  17. test_ids
  18. FROM
  19. $input
  20. FLATTEN BY event_ids AS event_id;