FAQ
For situations like "WHERE A = 1 OR A = 2", given that 1 and 2 are
literals, I've also used a predicate like:

(contains? #{1 2} ?a)

-- Elango

On Mon, Sep 23, 2013 at 2:35 AM, Philippe Guillebert wrote:

Hi

Have a look at
http://nathanmarz.github.io/cascalog/cascalog.ops.html#var-any


On Mon, Sep 23, 2013 at 10:01 AM, Alexey Larin wrote:

Hi All,
Sorry for up old topic.
I am also newbie in Cascalog and I am cannot find example how to do
logical OR filter.

Something like SQL
WHERE A=1 or A=2

Thanks for help
Alexey L.

вторник, 26 июня 2012 г., 7:40:02 UTC+4 пользователь Mayank Agarwal
написал:
Hi Kunal,

Looks to me that you want to join data1 and data2 on "?s" and the
filters are:
(not= ?s ?s2) and (< ?u 4)

Because a cascalog query can take multiple filter predicates, you can do:

(?<- (stdout) [?u ?s] (data1 ?u ?s _) (data2 ?s ?s2) (not= ?s ?s2) (< ?u
4))

let me know if this doesn't work.

Mayank

On Mon, Jun 25, 2012 at 8:05 PM, Kunal Mishra wrote:

Hi,

I am a Cascalog enthusiast and very new to it. I am working on a
project and am struck with a query where I would like to use logical "and".
But when I use and as

(?<- (stdout) [?u ?s](data1 ?u ?s _)(data2 ?s ?s2)(and (not= ?s ?s2) (<
?u 4)))

I get the error

Can't take the value of a macro #'clojure.core/and

I then defined a function for "and"

(defn and_op [a b] (and a b))

and used that but then I got the error ?s is not defined

I would sincerely appreciate any help in this regard.

Thanks,
Kunal
--
You received this message because you are subscribed to the Google Groups
"cascalog-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cascalog-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
*
Philippe*

--
You received this message because you are subscribed to the Google Groups
"cascalog-user" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cascalog-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "cascalog-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cascalog-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 7 | next ›
Discussion Overview
groupcascalog-user @
categoriesclojure, hadoop
postedJun 26, '12 at 3:10a
activeSep 23, '13 at 8:43p
posts7
users7
websiteclojure.org
irc#clojure

People

Translate

site design / logo © 2021 Grokbase