O'Reilly logo

Clojure Recipes by Julian Gamble

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16. Writing Out a Data File with Cascalog

In this chapter we cover writing a data file out of Cascalog.

Assumptions

In this chapter we assume you have Leiningen set up.

Benefits

The benefit of this chapter is understanding and applying the fact that Hadoop is a batch processing system that writes the results of its computation to a data sink somewhere. In this chapter, we’ll write it to a file.

The Recipe—Code

Now we’ll look at reporting the results out of Cascalog to a file.

1. Create a new Leiningen project cascalog-file-output in your projects directory, and change to that directory:

lein new app cascalog-file-output cd cascalog-file-output

2. Ensure that the following is in your projects.clj file:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required