Created
January 16, 2015 10:41
-
-
Save erasmas/83c39441351a7fe1db26 to your computer and use it in GitHub Desktop.
WordCount in Cascalog
This file contains hidden or 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 cascalog-class.core | |
(:require [cascalog.api :refer :all] | |
[cascalog.ops :as c])) | |
(defmapcatop split | |
[^String sentence] | |
(.split sentence "\\s+")) | |
(def -main | |
(?<- (stdout) | |
[?word ?count] | |
((hfs-textline "input-dir") ?textline) | |
(split ?textline :> ?word) | |
(c/count ?count))) | |
;; https://github.com/sritchie/cascalog-class/blob/master/src/cascalog_class/core.clj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment