How much do Cascalog Traps thread into other functions?

128 views Asked by At

I was wondering how far down cascalog traps boiled down using the following example.

(defn -main
 "Good ole main boilerplate"
 [people-path trap-path output-path]
 (?- (hfs-textline output-path)
     (people-query (hfs-textline trap-path)
                   (hfs-textline people-path))))

(defn people-query
  "The people query!"
  [trap-path people-path]
  (<- [?first-name ?last-name ?daily-visits]
      (:trap trap)
      (some-generic-parsing-to-tuple-fn people-path :> ?fname ?lname)
      (c/count ?daily-visits)))

If some-generic-parsing-to-tuple-fn is called within the scope of the people-query (which contains the (:trap trap) will the sub query also have access to that trap or should the some-generic-parsing-to-tuple-fn also contain the trap information i.e.

 (some-generic-parsing-to-tuple-fn trap-path people-path :> ?fname ?lname)

TL;DR How much do I need to pass around traps in Cascalog queries in order to allow nested queries to have access to the trap

0

There are 0 answers