cascalog icon indicating copy to clipboard operation
cascalog copied to clipboard

Constants don't work in aggregator predicates

Open sritchie opened this issue 13 years ago • 2 comments

e.g. (c/count 5) or (c/sum 2 :> ?s)

sritchie avatar Dec 06 '11 03:12 sritchie

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)))

sritchie avatar Jan 03 '12 07:01 sritchie

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.

sritchie avatar Jul 16 '13 01:07 sritchie