Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Apache Cassandra - Second Edition
  • Table Of Contents Toc
  • Feedback & Rating feedback
Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

By : Nishant Neeraj
4.6 (10)
close
close
Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

4.6 (10)
By: Nishant Neeraj

Overview of this book

The book is aimed at intermediate developers with an understanding of core database concepts who want to become a master at implementing Cassandra for their application.
Table of Contents (10 chapters)
close
close

Cassandra and Hadoop in action


Now, with more than enough (rather boring) theory, we are ready to do something exciting. In this section, we will do a word count of a book. It will be more interesting than the grep example.

In this example, we load Lewis Carroll's novel Alice in Wonderland (http://en.wikipedia.org/wiki/Alice%27s_Adventures_in_Wonderland) in Cassandra. To prepare this data, we read the text file line by line and store 500 lines in one row. The row names are formatted as row_1, row_2, and so on, and the columns in each row have names such as col_1, col_2, and so on. Each row has almost 500 columns, and each column has one line from the file. To avoid noise, we have removed the punctuation from the lines during the load. We could certainly work on the noise reduction in the MapReduce code, but we wanted to keep it simple. What follows is the code and its explanation. It is recommended to download the code either from my GitHub account or from the book's website. Keep it handy...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete