Skip to content

Instantly share code, notes, and snippets.

@phosphene
Last active August 29, 2015 13:57
Show Gist options
  • Save phosphene/9420223 to your computer and use it in GitHub Desktop.
Save phosphene/9420223 to your computer and use it in GitHub Desktop.
install cascalog, hadoop, etc. all in one go. a few minutes and we have a testable, queryable, hadoop instance in place.
simple steps to clojure cascalog
is ~/bin in your $PATH
at term type: echo $PATH
if not there add this to .bash_profile:
export PATH=$HOME/bin:$PATH
then:
cd ~/bin
then:
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
then:
chmod +x lein
then:
lein
will autoinstall clojure and all deps asssuming you have Java jdk in path
then:
cd ~/
then:
lein new [project_name]
then:
cd project_name
then:
vi project.clj
then:
add this to project.clj
:repositories {"conjars" "http://conjars.org/repo"}
:dependencies [[cascalog/cascalog-core "2.0.0"][org.clojure/clojure
"1.5.1"]]
:profiles { :dev {:dependencies [[org.apache.hadoop/hadoop-core "1.1.2"]]}})
you will overwrite only original deps definition
then:
lein repl
and it should install cascalog for you and start the repl!
at the repl you get a user prompt
try this:
user=> (use 'cascalog.playground) (bootstrap)
then try your first query:
user=> (?<- (stdout) [?person] (age ?person 25))
the data will be in playground.clj
next we will add testing!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment