AggrCount.yqls 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. (
  2. #comment
  3. (let config (DataSource 'config))
  4. (let world (Configure! world config 'PureDataSource 'yt))
  5. (let res_sink (DataSink 'result))
  6. (let x (Int32 '34))
  7. (let jx (Just x))
  8. (let n (Nothing (TypeOf jx)))
  9. (let world (Write! world res_sink (Key) (AggrCountInit x) '('('type))))
  10. (let world (Write! world res_sink (Key) (AggrCountInit jx) '('('type))))
  11. (let world (Write! world res_sink (Key) (AggrCountInit n) '('('type))))
  12. (let world (Write! world res_sink (Key) (AggrCountUpdate x (Uint64 '10)) '('('type))))
  13. (let world (Write! world res_sink (Key) (AggrCountUpdate jx (Uint64 '10)) '('('type))))
  14. (let world (Write! world res_sink (Key) (AggrCountUpdate n (Uint64 '10)) '('('type))))
  15. (let cx (Callable (ParseType '"()->Int32") (lambda '() x)))
  16. (let cjx (Callable (ParseType '"()->Int32?") (lambda '() jx)))
  17. (let cn (Callable (ParseType '"()->Int32?") (lambda '() n)))
  18. (let world (Write! world res_sink (Key) (AggrCountInit (Apply cx)) '('('type))))
  19. (let world (Write! world res_sink (Key) (AggrCountInit (Apply cjx)) '('('type))))
  20. (let world (Write! world res_sink (Key) (AggrCountInit (Apply cn)) '('('type))))
  21. (let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cx) (Uint64 '10)) '('('type))))
  22. (let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cjx) (Uint64 '10)) '('('type))))
  23. (let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cn) (Uint64 '10)) '('('type))))
  24. (let world (Commit! world res_sink))
  25. (return world)
  26. )