Fork me on GitHub
#xtdb
<
2019-09-12
>
jjttjj15:09:54

Did anything change from version 19.07-1.3 to 19.09-1.4 relating to predicates in queries? This used to work for me but now is throwing a n error:

;;in where clause
'[(t/>= from t1)]
'[(t/<= to t2 )]

;;=> results in
Execution error (IllegalArgumentException) at crux.query/validate-existing-vars (query.clj:550).
Clause refers to unknown variable: t/>= {:pred {:pred-fn t/>=, :args [from t1]}}

refset20:09:35

Hey, yeah, if the above used to work that was by accident. It needs to be a fully qualified namespace or inside clojure.core, and this is kind of by design as otherwise you need to know which ns is executing (or even worse, defining) the query

jjttjj21:09:22

Makes sense thanks

👍 4
jjttjj15:09:41

(t1 and t2 are bound earlier in the :where clause and to and from are :args)

refset20:09:43

Hi, hmm, interesting. Which version of Clojure / lein are you using?

match3717:09:13

terribly sorry that I missed this message (not used to thread I guess). Might be my VPN/download though (behind company firewall). Will try again from home.

match3700:09:46

lein -v
Leiningen 2.8.1 on Java 1.8.0_162 Java HotSpot(TM) 64-Bit Server VM

match3700:09:07

cat project.clj 
(defproject crux-play "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url ""
  :license {:name "Eclipse Public License"
            :url ""}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [juxt/crux-core "19.09-1.4.0-alpha"]
                 [juxt/crux-jdbc "19.09-1.4.0-alpha"]
                 ]
  ;  :repositories {"local" ~(str (.toURI (java.io.File. "/Users/xuwang/.m2/repository")))}
  ;  :local-repo "/Users/xuwang/.m2/repository"
  :main ^:skip-aot crux-play.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}})
 

match3700:09:03

Ah, clojure 1.10.0 works. Thanks!

refset14:09:10

Great! Glad that wasn't too awful. I will see if we can make that clearer somewhere

jjttjj19:09:52

https://clojurians.slack.com/archives/CG3AM2F7V/p1568300694094600 ok I think I found the discussion related to this and some info on how to use fns now here: https://github.com/juxt/crux/issues/121