Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2012 21:25
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
(use '
;; put stuff in pail
(let [pail-path "/Users/robin/delete/tmp/newpail"
vcf-src [(thrift/DataChunk* "vcf"
(thrift/ModisPixelLocation* "500" 28 8 0 0)
gadm-src [(thrift/DataChunk* "gadm"
(thrift/ModisPixelLocation* "500" 28 8 0 0)
vcf-query (<- [?dc]
(vcf-src ?dc))
gadm-query (<- [?dc]
(gadm-src ?dc))]
(to-pail pail-path vcf-query)
(to-pail pail-path gadm-query))
(defn unpack-long
"Unpack long value from static source"
(.getLongVal dv))
;; get values out of pail
;; data comes out when there's one source, but joining on sres h v s l produces nothing
(let [pail-path "/Users/robin/delete/tmp/newpail"
vcf-src (split-chunk-tap pail-path ["vcf"])
gadm-src (split-chunk-tap pail-path ["gadm"])
(<- [?sres ?h ?v ?s ?l ?vcf ?gadm]
(vcf-src _ ?vcf-obj)
(thrift/unpack ?vcf-obj :> _ ?vcf-loc ?vcf-dv _ _)
(thrift/unpack ?vcf-loc :> ?sres ?h ?v ?s ?l)
(unpack-long ?vcf-dv :> ?vcf)
(gadm-src _ ?gadm-obj)
(thrift/unpack ?gadm-obj :> _ ?gadm-loc ?gadm-dv _ _)
(thrift/unpack ?gadm-loc :> ?sres ?h ?v ?s ?l)
(unpack-long ?gadm-dv :> ?gadm)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment