Created
December 13, 2011 22:41
-
-
Save sorenmacbeth/1474287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ybot.analytics.edb | |
(:use [ybot bootstrap datastores]) | |
(:use elephantdb.cascalog.core) | |
(:import [elephantdb.persistence JavaBerkDB] | |
[org.apache.hadoop.io BytesWritable])) | |
(bootstrap-ybot) | |
(defn ser-long [val] | |
(BytesWritable. (.getBytes (str val)))) | |
(defn url-counts [root] | |
(let [ga (select-fields (gadata-tap root) "!url") | |
counts (<- [?url ?count] | |
(ga ?url) | |
(c/count ?count))] | |
(<- [?key ?val] | |
(counts ?key ?rawval) | |
(ser-long ?rawval :> ?val)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment