This program forms the reducer of a Hadoop MapReduce job. It reads data in from stdin that is tab delimited.foo    1foo    1bar    1and outputsfoo    2bar    1Any suggestions for improvements?(use '[clojure.string :only [split]])(def reducer (atom {}))(defn update-map [map key]  (merge-with + map {key 1}))(doseq [line (line-seq (java.io.BufferedReader. *in*))]  (let [k (first (split line #\t))]    (swap! reducer update-map k)))(doseq [kv @reducer]  (println (format %s\t%s (first kv) (second kv))))
Clojure MapReduce Reducer
clojure