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
| ;; maybe cascalog.ops/max is good enough? | |
| (<- [?a ?b ?c ?max-score] | |
| (tap ?a ?b ?c) | |
| (score-fn ?a ?b :> ?score) | |
| (cascalog.ops/max ?score :> ?max-score) |
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
| (require '[cascalog.api :as ca] | |
| '[cascalog.ops :as co]) | |
| (def person | |
| ;; [person gender age] | |
| [ | |
| ["alice" "f" 28] | |
| ["bob" "m" 33] | |
| ["chris" "m" 40] | |
| ["david" "m" 25] |
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
| (use 'cascalog.api) | |
| (def data [[1 1] | |
| [1 2] | |
| [1 3] | |
| [2 1] | |
| [2 2] | |
| [2 3]]) | |
| (defbufferop top-2 [tuples] |
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
| (defn hfs-textline | |
| "Creates a tap on HDFS using textline format. Different filesystems can | |
| be selected by using different prefixes for {path}. | |
| See http://www.cascading.org/javadoc/cascading/tap/Hfs.html and | |
| http://www.cascading.org/javadoc/cascading/scheme/TextLine.html" | |
| ([path] | |
| (hfs-textline path :keep)) | |
| ([path sink-mode] | |
| (-> (w/text-line ["line"] Fields/ALL) |