StreamInGroupByKey.yqls 435 B

123456789101112
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let res_sink (DataSink 'result))
  5. (let list (AsList '((Uint32 '1) (String 'a)) '((Uint32 '1) (String 'b)) '((Uint32 '2) (String 'c))))
  6. (let keyExtractor (lambda '(x) (Nth x '0)))
  7. (let handler (lambda '(key list) (Iterator (AsList key key))))
  8. (let world (Write! world res_sink (Key) (GroupByKey list keyExtractor handler) '('('type))))
  9. (let world (Commit! world res_sink))
  10. (return world)
  11. )