Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Scala and Spark for Big Data Analytics

You're reading from  Scala and Spark for Big Data Analytics

Product type Book
Published in Jul 2017
Publisher Packt
ISBN-13 9781785280849
Pages 796 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Md. Rezaul Karim Md. Rezaul Karim
Profile icon Md. Rezaul Karim
Sridhar Alla Sridhar Alla
Profile icon Sridhar Alla
View More author details

Table of Contents (19) Chapters

Preface Introduction to Scala Object-Oriented Scala Functional Programming Concepts Collection APIs Tackle Big Data – Spark Comes to the Party Start Working with Spark – REPL and RDDs Special RDD Operations Introduce a Little Structure - Spark SQL Stream Me Up, Scotty - Spark Streaming Everything is Connected - GraphX Learning Machine Learning - Spark MLlib and Spark ML My Name is Bayes, Naive Bayes Time to Put Some Order - Cluster Your Data with Spark MLlib Text Analytics Using Spark ML Spark Tuning Time to Go to ClusterLand - Deploying Spark on a Cluster Testing and Debugging Spark PySpark and SparkR

Methods, classes, and objects in Scala

In the previous section, we saw how to work with Scala variables, different data types and their mutability and immutability, along with their usages scopes. However, in this section, to get the real flavor of the OOP concept, we are going to deal with methods, objects, and classes. These three features of Scala will help us understand the object-oriented nature of Scala and its features.

Methods in Scala

In this part, we are going to talk about methods in Scala. As you dive into Scala, you'll find that there are lots of ways to define methods in Scala. We will demonstrate them in some of these ways:

def min(x1:Int, x2:Int) : Int = {
if (x1 < x2) x1 else x2
}

The preceding declaration...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}