Last active
December 15, 2015 04:18
-
-
Save robinkraft/5200079 to your computer and use it in GitHub Desktop.
Cascading template tap example using 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
;; dumps data into directories based on template, à la | |
;; /tmp/test-template/2012-01-01/a/part-00000 | |
;; /tmp/test-template/2012-01-01/b/part-00000 | |
;; /tmp/test-template/2013-12-31/a/part-00000 | |
(let [src [["2012-01-01" "a" 2] | |
["2012-01-01" "b" 3] | |
["2013-12-31" "a" 4]]] | |
(?- (hfs-seqfile "/tmp/test-template" | |
:sink-template "%s/%s" | |
:templatefields ["?a" "?b"] | |
:outfields ["?c"]) | |
(<- [?a ?b ?c] | |
(src ?a ?b ?c)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment