AggrCount.yqls 1.4 KB

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