EquiInnerFull3OptStr.yql 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. (
  2. (let mr_source (DataSource 'yt 'plato))
  3. (let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
  4. (let world (Left! x))
  5. (let table1 (Right! x))
  6. (let table1 (Map table1 (lambda '(item) (AsStruct
  7. '('key (Just (Member item 'key)))
  8. '('subkey (Just (Member item 'subkey)))
  9. '('value (Just (Member item 'value)))))))
  10. (let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
  11. (let world (Left! x))
  12. (let table2 (Right! x))
  13. (let table2 (Map table2 (lambda '(item) (AsStruct
  14. '('key (Just (Member item 'key)))
  15. '('subkey (Just (Member item 'subkey)))
  16. '('value (Just (Member item 'value)))))))
  17. (let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
  18. (let world (Left! x))
  19. (let table3 (Right! x))
  20. (let table3 (Map table3 (lambda '(item) (AsStruct
  21. '('key (Just (Member item 'key)))
  22. '('subkey (Just (Member item 'subkey)))
  23. '('value (Just (Member item 'value)))))))
  24. (let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c)
  25. '('Inner
  26. '('Full '"a" '"b" '('"a" '"key") '('"b" '"key" ) '())
  27. '"c" '('"a" '"key") '('"c" '"key") '()) '()))
  28. (let res_sink (DataSink 'result))
  29. (let world (Write! world res_sink (Key) join '('('type))))
  30. (let world (Commit! world res_sink))
  31. (return world)
  32. )