SkipTakeThenMapTreeTables.yql 1023 B

12345678910111213141516171819202122232425262728
  1. (
  2. #comment
  3. (let mr_source (DataSource 'yt 'plato))
  4. (let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
  5. (let world (Left! x))
  6. (let table1 (Right! x))
  7. (let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
  8. (let world (Left! x))
  9. (let table2 (Right! x))
  10. (let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
  11. (let world (Left! x))
  12. (let table3 (Right! x))
  13. (let e (Extend table1 (Extend table2 table3)))
  14. (let e (Skip e (Uint64 '5)))
  15. (let e (Take e (Uint64 '6)))
  16. (let table1map (Map e (lambda '(item) (block '(
  17. (let value (Member item 'value))
  18. (let s (Struct))
  19. (let s (AddMember s 'key (Member item 'key)))
  20. (let s (AddMember s 'subkey (String '"")))
  21. (let s (AddMember s 'value value))
  22. (return s)
  23. )))))
  24. (let mr_sink (DataSink 'yt (quote plato)))
  25. (let world (Write! world mr_sink (Key '('table (String 'Output))) table1map '('('mode 'append))))
  26. (let world (Commit! world mr_sink))
  27. (return world)
  28. )