cascalog
cascalog copied to clipboard
Constants don't work in aggregator predicates
e.g. (c/count 5)
or (c/sum 2 :> ?s)
A more detailed example:
(defn count-if-x* [word x]
(if (= word x) 1 0))
(defparallelagg count-if-x
:init-var #'count-if-x*
:combine-var #'+)
(let [src ["hi" "hi" "jake"]]
(??<- [?count]
(src ?word)
(identity "hi" :> ?test)
(count-if-x ?word ?test :> ?count)))
We should be able to run
(let [src ["hi" "hi" "jake"]]
(??<- [?count]
(src ?word)
(count-if-x ?word "hi" :> ?count)))
We can fix this in Cascalog 2.0 by using the "logically" function inside of co-group to generate temporary variables. shouldn't be too tough.