Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/hadoop/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hadoop Cascalog first-n-无法连接谓词_Hadoop_Clojure_Cascading_Cascalog - Fatal编程技术网

Hadoop Cascalog first-n-无法连接谓词

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

我正在从中克隆一个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 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))