Book Image

Learning Big Data with Amazon Elastic MapReduce

By : Amarkant Singh, Vijay Rayapati
Book Image

Learning Big Data with Amazon Elastic MapReduce

By: Amarkant Singh, Vijay Rayapati

Overview of this book

<p>Amazon Elastic MapReduce is a web service used to process and store vast amount of data, and it is one of the largest Hadoop operators in the world. With the increase in the amount of data generated and collected by many businesses and the arrival of cost-effective cloud-based solutions for distributed computing, the feasibility to crunch large amounts of data to get deep insights within a short span of time has increased greatly.</p> <p>This book will get you started with AWS so that you can quickly create your own account and explore the services provided, many of which you might be delighted to use. This book covers the architectural details of the MapReduce framework, Apache Hadoop, various job models on EMR, how to manage clusters on EMR, and the command-line tools available with EMR. Each chapter builds on the knowledge of the previous one, leading to the final chapter where you will learn about solving a real-world use case using Apache Hadoop and EMR. This book will, therefore, get you up and running with major Big Data technologies quickly and efficiently.</p>
Table of Contents (18 chapters)
Learning Big Data with Amazon Elastic MapReduce
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Output ingestion to a data store


As discussed earlier, we are going to use MySQL. In any MySQL server, either local or remote, create two tables, details_by_city_country and details_by_ip. Let's just focus on the details_by_city_country table. In accordance with the output from our reducer, you can create it using the following command:

CREATE TABLE details_by_city_country (
date date NOT NULL,
filename varchar(100) NOT NULL,
http_status_code integer NOT NULL,
city varchar(100) NOT NULL,
country varchar(100) NOT NULL,
edge_location varchar(10) NOT NULL,
request_count BIGINT NOT NULL,
hit_count BIGINT NOT NULL,
miss_count BIGINT NOT NULL,
error_count BIGINT NOT NULL,
bytes_transferred BIGINT NOT NULL
);

You should combine all the output in <output-directory-path>/detailsbycitycountry/ using the following command:

zcat output-directory-path>/detailsbycitycountry/part-r-* > detailsbycitycountry.csv

Now, you can import it to MySQL using the LOAD DATA LOCAL INFILE command of MySQL...