Hadoop Cascalog first-n-无法连接谓词
我正在从中克隆一个lein repl。我跑过:Hadoop Cascalog first-n-无法连接谓词,hadoop,clojure,cascading,cascalog,Hadoop,Clojure,Cascading,Cascalog,我正在从中克隆一个lein repl。我跑过: (def src [[1] [3] [2]]) (def queryx (<- [?x ?y] (src ?x) (inc ?x :> ?y))) (?<- (stdout) [?x ?y] (queryx ?x ?y)) -- works (?- (stdout) queryx) ;; produces (([1 2] [2 3] [3 4])) -- works (?- (stdout) (first-n query
(def src [[1] [3] [2]])
(def queryx (<- [?x ?y] (src ?x) (inc ?x :> ?y)))
(?<- (stdout) [?x ?y]
(queryx ?x ?y))
-- works
(?- (stdout) queryx) ;; produces (([1 2] [2 3] [3 4]))
-- works
(?- (stdout) (first-n queryx 1 :sort ["?x"] :reverse true))
--works
这似乎是一个查询创建与执行的问题。是否可以创建一个执行此查询的查询?根据文档,
first-n
返回一个查询,并且查询对象也作为数据源
以您自己为例,如果您这样做:
(?<- (stdout) [?x ?y] (queryx ?x ?y))
(?
IllegalArgumentException Unable to join predicates together jackknife.core/throw-illegal (core.clj:100)
(?<- (stdout) [?x ?y] (queryx ?x ?y))
(?<- (stdout) [?x ?y] ((first-n queryx 1 :sort ["?x"] :reverse true) ?x ?y))