|
Nathan Marz |
at Jan 31, 2012 at 1:59 am
|
⇧ |
| |
You can do this:
(defn bool-or [& vars]
(boolean (some identity vars)))
(?<- (stdout) [?person]
(age ?person ?age)
(= ?age 30 :> ?old)
(= ?person "bob" :> ?bob)
(bool-or ?old ?bob))
bool-or is actually defined in cascalog.ops-impl, but perhaps we should
promote it to cascalog.ops.
-Nathan
On Mon, Jan 30, 2012 at 1:49 AM, Gerrard McNulty
wrote:
How do I make a query in cascalog with an or e.g. suppose in nathan's
original tutorial, I wanted to query for all people whose name is bob
'or' their age is 30? I can't use:
(?<- (stdout) [?person]
(age ?person ?age)
(or (= ?age 30) (= ?person "bob")))
is there an equivalent?
--
Twitter: @nathanmarz
http://nathanmarz.com