Skip to content

Instantly share code, notes, and snippets.

@nathanmarz
Created September 23, 2011 20:53
Show Gist options
  • Save nathanmarz/1238411 to your computer and use it in GitHub Desktop.
Save nathanmarz/1238411 to your computer and use it in GitHub Desktop.
Cascalog operation redesign
(defaggregateop my-aggregator
{:params [a b c]
:prepare true}
[flow-process]
(let []
(aggregator
(init []
)
(aggregate [state field1 field2]
)
(complete [state]
)
(cleanup []
))))
(defaggregateop my-aggregator2
{:params [a b c]}
(init []
)
(aggregate [state field1 field2]
)
(complete [state]
))
(defbufferop my-buffer [tuples]
)
(deffilterop my-filter
{:params [a b c]
:prepare true}
[flow-process]
(let []
(operation
(execute [field1 field2]
)
(cleanup []
))))
(deffilterop my-filter2 {:params [a b c]}
[field1 field2]
)
(def op (my-filter2 1 2 3))
(deffilterop my-filter3 [field1 field2]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment