FAQ

[cascalog-user] can I wrap (eg) defmapop instead my own macro (generically wrap Pig UDFs as cascalog operators)

Nathan Marz
Feb 23, 2012 at 4:30 am
Not currently, unfortunately. But we have a redesign of the ops planned
that will make that possible.

On Wed, Feb 22, 2012 at 6:40 PM, R Daneel wrote:

Oops: one more thing! Here's my (working, generic) operator (thanks
again!):

(defmapop
[pig-eval-func [pig-func]] [& x]
(into [] (.getAll (.call (.newInstance pig-func) (.newDefaultBag bf
(apply map (fn [y] (.newTuple tf y)) x))))))

and here's how I call it:

(pig-eval-func [datafu.pig.stats.Median] ?x :> ?fx)

buy in this form I can't figure out how to wrap it with c/each, ie. so I
can call it like this:

(pig-eval-func [datafu.pig.stats.Median] ?x ?y :> ?fx ?fy)

Is that possible without drastic surgery?


--
Twitter: @nathanmarz
http://nathanmarz.com
reply

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 10 | next ›

2 users in discussion

R Daneel: 6 posts Nathan Marz: 4 posts