Skip to Content
Big Data Analytics with Java
book

Big Data Analytics with Java

by RAJAT MEHTA
July 2017
Beginner to intermediate
418 pages
9h 46m
English
Packt Publishing
Content preview from Big Data Analytics with Java

Data exploration

In this section, we will explore this dataset and try to perform some simple and useful analytics on top of this dataset.

First, we will create the boilerplate code for Spark configuration and the Spark session:

SparkConf conf = ...
SparkSession session = ...

Next, we will load the dataset and find the number of rows in it:

Dataset<Row> rawData = session.read().csv("data/retail/Online_Retail.csv");

This will print the number of rows in the dataset as:

Number of rows --> 541909

As you can see, this is not a very small dataset but it is not big data either. Big data can run into terabytes. We have seen the number of rows, so let's look at the first few rows now.

rawData.show();

This will print the result as:

As you can see, this dataset is ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Science with Java

Data Science with Java

Michael R. Brzustowicz
Data Science on AWS

Data Science on AWS

Chris Fregly, Antje Barth
Machine Learning: End-to-End guide for Java developers

Machine Learning: End-to-End guide for Java developers

Richard M. Reese, Jennifer L. Reese, Boštjan Kaluža, Dr. Uday Kamath, Krishna Choppella

Publisher Resources

ISBN: 9781787288980Supplemental Content