{"id":14435,"date":"2020-10-12T05:33:35","date_gmt":"2020-10-12T05:33:35","guid":{"rendered":"https:\/\/www.learnovita.com\/?p=14435"},"modified":"2025-04-09T05:15:43","modified_gmt":"2025-04-09T05:15:43","slug":"apache-spark-scala-tutorial","status":"publish","type":"post","link":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial","title":{"rendered":"Apache Spark &#038; Scala Tutorial"},"content":{"rendered":"\r\n<p><h3 class=\"blog-title-4\">What is Apache Spark?<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Apache Spark is an open-source cluster computing framework that was initially developed at UC Berkeley in the AMPLab.<\/li><li>As compared to the disk-based, two-stage MapReduce of Hadoop, Spark provides up to 100 times faster performance for a few applications with in-memory primitives.<\/li><li>This makes it suitable for machine learning algorithms, as it allows programs to load data into the memory of a cluster and query the data constantly.<\/li><li>A Spark project contains various components such as Spark Core and Resilient Distributed Datasets or RDDs, Spark SQL, Spark Streaming, Machine Learning Library or Mllib, and GraphX.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">What is Apache Scala?<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Scala is a modern and multi-paradigm programming language. It has been designed for expressing general programming patterns in an elegant, precise, and type-safe way. One of the prime features is that it integrates the features of both object-oriented and functional languages smoothly.<\/li><li>It is a pure object-oriented language, as every value in it is an object. The objects\u2019 behavior and types are explained through traits and classes.<\/li><li>It is also a functional language, as every function in it is a value. By providing a lightweight syntax for defining anonymous functions, it provides support for higher-order functions.&nbsp;&nbsp;<\/li><li>In addition, the language also allows functions to be nested and provides support for carrying. It also has features like case classes and pattern matching model algebraic types support.<\/li><li>Scala is statically typed, being empowered with an expressive type system. The system enforces the use of abstractions in a coherent and safe way. To be particular, this system supports various features like annotations, classes, views, polymorphic methods, compound types, explicitly typed self-references and upper and lower type bounds.<\/li><li>When it comes to developing domain-specific applications, it generally needs domain-specific language extensions. Scala, being extensible, provides an exceptional combination of language mechanisms. Due to this, it becomes easy to add new language constructs as libraries<\/li><\/ul>\r\n\r\n\r\n<div class=\"inline-forms\">\n<h5>Subscribe For Free Demo<span class=\"spacer\"><\/span><\/h5>\n<p class=\"wpcf7-contact-form-not-found\"><strong>Error:<\/strong> Contact form not found.<\/p><\/div>\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Benefits of Apache Spark and Scala to Professionals and Organizations<\/h3><\/p>\r\n\r\n\r\n\r\n<p>Following are the benefits of Apache Spark and Scala<\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Provides highly reliable fast in memory computation.<\/li><li>Efficient in interactive queries and iterative algorithms.<\/li><li>Fault tolerance capabilities because of immutable primary abstraction named RDD.<\/li><li>Inbuilt machine learning libraries.<\/li><li>Provides a processing platform for streaming data using spark streaming.<\/li><li>Highly efficient in real time analytics using spark streaming and spark sql.<\/li><li>Graphx libraries on top of spark core for graphical observations.<\/li><li>Compatibility with any api JAVA, SCALA, PYTHON, R makes programming easy.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Initializing Spark<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>There are several approaches to initialize a Spark application depending on the use case, the application may be one that leverages RDD, Spark Streaming, Structured SQL with Dataset or DataFrame. Therefore, it is important to understand how to initialize these different Spark instances.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">1. RDD with Spark Context:<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Operations with spark-core are initiated by creating a spark context, the context is created with a number of configurations such as the master location, application names, memory size of executors to mention a few.<\/li><li>Here are two ways to initiate a spark context as well as how to make an RDD with the created spark context.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">2. DataFrame\/Dataset with Spark Session:<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>As observed above, an entry point to Spark could be by using the Spark Context, however, Spark allows direct interaction with the Structured SQL API with Spark Session. It also involves specifying the configuration for the Spark app.<\/li><li>Here is the approach to initiate a Spark Session and create a Dataset and DataFrame with the Session.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">3. DStream with Spark Streaming:<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>The other entry point to Spark is using the Streaming Context when interacting with real-time data. An instance of Streaming Context can either be created from a Spark Configuration or a Spark Context.&nbsp;<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Install Scala<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>To begin writing Scala programs, you need to have it installed on your computer. In order to do this, you will need to visit their site https:\/\/www.scala-lang.org\/download\/ in order to download the latest version of Scala.<\/li><\/ul>\r\n\r\n\r\n\r\n<p>Following the link, we\u2019re led to two options which we can choose to install Scala on our machines.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"414\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala-1.png\" alt=\"Apache-Scala -1\" class=\"wp-image-15049\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala-1.png 739w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala-1-300x168.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Once you visit the download link, you\u2019ll find two versions of the IntelliJ IDE.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"618\" height=\"314\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala10.png\" alt=\"Apache-Scala\" class=\"wp-image-15044\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala10.png 618w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala10-300x152.png 300w\" sizes=\"auto, (max-width: 618px) 100vw, 618px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Step 1) on the page, click on the dropdown on the Community Edition.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"448\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala9.png\" alt=\"Apache-Spark-9\" class=\"wp-image-15041\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala9.png 441w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala9-295x300.png 295w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>It presents us with an option to download the IntelliJ IDE together with JBR which contains a JDK implementation(Java Development Kit) OpenJDK which Scala needs to compile and run the code.<\/li><li>Step 2) Once you download IntelliJ, double click it in order to run the installation wizard and follow the dialog.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"498\" height=\"383\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala8.png\" alt=\"Apache-Spark-8\" class=\"wp-image-15039\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala8.png 498w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala8-300x231.png 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Step 3) Choose a location to install the IDE.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"487\" height=\"385\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala7.png\" alt=\"Apache-Spark-7\" class=\"wp-image-15037\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala7.png 487w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala7-300x237.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>If by chance you didn\u2019t download the one with the JDK, we still get a prompt where we can check to download it by selecting the checkbox.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"497\" height=\"379\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala6.png\" alt=\"Apache-Spark-6\" class=\"wp-image-15034\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala6.png 497w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala6-300x229.png 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Step 4) Leave the other defaults as they are and click next.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"385\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala5.png\" alt=\"Apache-Spark-5\" class=\"wp-image-15033\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala5.png 490w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala5-300x236.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Step 5) Once the installation completes, run the IntelliJ IDE by clicking its startup icon in the startup menu like a regular application.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"480\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala4.png\" alt=\"Apache-Spark-4\" class=\"wp-image-15030\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala4.png 774w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala4-300x186.png 300w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala4-768x476.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>You still need to go through an additional step of adding the Scala plugin to IntelliJ; you do so by clicking the dropdown on the configure menu located at the bottom right of the screen and selecting the plugin option.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"617\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala3.png\" alt=\"Apache-Spark-3\" class=\"wp-image-15029\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala3.png 593w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala3-288x300.png 288w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"657\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala2.png\" alt=\"Apache-Spark\" class=\"wp-image-15028\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala2.png 798w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala2-300x247.png 300w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala2-768x632.png 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>On the Marketplace tab, a search for Scala will present the plugin as the first result under the Languages tag.<\/li><li>Step 6) Click install, which will lead the plugin beginning the download.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"317\" height=\"305\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala1.png\" alt=\"Apache-Spark-Navigate-Scala\" class=\"wp-image-15026\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala1.png 317w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala1-300x289.png 300w\" sizes=\"auto, (max-width: 317px) 100vw, 317px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Step 7) After the download completes, you\u2019ll be prompted to restart the IDE so that the installed plugin can start working.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"253\" height=\"321\" src=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala.png\" alt=\"Apache-Spark-Navigate\" class=\"wp-image-15025\" srcset=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala.png 253w, https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Scala-236x300.png 236w\" sizes=\"auto, (max-width: 253px) 100vw, 253px\" \/><\/figure><\/div>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>After restarting you\u2019ll find yourself on the same page as before when we ran the IDE, but this time around we have already installed the Scala plugin.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"row course-curriculum-widget m-0 my-4 p-3 align-items-center\"><div class=\"col-xl-4 col-lg-4 col-md-4 col-12\">\r\n<img decoding=\"async\" src=\"https:\/\/www.acte.in\/wp-content\/uploads\/2020\/08\/Site-images-01-1.png\" alt=\"Course Curriculum\"><\/div>\r\n<div class=\"col-xl-8 col-lg-8 col-md-8 col-12 course-details-section\">\r\n<h3>Take Your Career to Next Level with UX Design Training to Advance Your Career<\/h3><ul class=\"p-0\">\r\n <li>Instructor-led Sessions<\/li>\r\n<li>Real-life Case Studies<\/li><li>Assignments<\/li><\/ul><a href=\"https:\/\/www.acte.in\/web-designing-training\" class=\"btn\">Explore Curriculum<\/a><\/div><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example of spark and scala<\/h3><\/p>\r\n\r\n\r\n\r\n<p>Spark Context example \u2013 *How to run Spark*<\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>If you are struggling to figure out how to run a Spark Scala program, this section gets straight to the point.<\/li><li>The first step to writing an Apache Spark application (program) is to invoke the program, which includes initializing the configuration variables and accessing the cluster. SparkContext is the gateway to accessing Spark functionality.<\/li><li>For beginners, the best and simplest option is to use the Scala shell, which auto creates a SparkContext. Below are 4 Spark Context examples on how to connect and run Spark.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 1:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To login to Scala shell, at the command line interface, type<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul><li>\u201c\/bin\/spark-shell \u201c<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<h3 class=\"blog-title-4\">Example 2:<\/h3>\r\n\r\n\r\n\r\n<p>To login and run Spark locally without parallelism:<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul><li>\u201c\/bin\/spark-shell \u2013master local \u201c.<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 3:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To login and run Spark locally in parallel mode, setting the parallelism level to the number of cores on your machine:<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>\u201c\/bing\/spark-shell \u2013master local[*] \u201c.&nbsp;<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 4:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To login and connect to Yarn in client mode:<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>\u201c\/bin\/spark-shell \u2013master yarn-client \u201c.<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Spark Scala Examples on Parallelize<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Parallelize is a method used to create an RDD in Apache Spark based on data that\u2019s already being processed in memory. It&#8217;s also a great method to generate an RDD on the fly for testing and debugging code.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 1:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To create an RDD using Apache Spark Parallelize method on a sample set of numbers, say 1 thru 100.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val parSeqRDD = sc.parallelize(1 to 100)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 2:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To create an RDD from a Scala List using the Parallelize method.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val parNumArrayRDD = sc.parallelize(List(\u201cpen\u201d,\u201dlaptop\u201d,\u201dpencil\u201d,\u201dmouse\u201d))<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p>Note: To view a sample set of data loaded in the RDD, type this at the command line: parAmArray RDD.take(3).foreach(println)<\/p>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 3:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To create an RDD from an Array using the Parallelize method.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; **val parNumArrayRDD = sc.parallelize(Array(1,2,3,4,5))*<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Spark read from hdfs example<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Creating an RDD in Apache Spark requires data. In Spark, there are two ways to acquire this data: parallelized collections and external datasets. Data not in an RDD is classified as an external dataset and includes flat files, binary files,sequence files, hdfs file format, HBase, Cassandra or in any random format.<\/li><li>The Spark Scala Examples listed below are some additional ways for Spark to read from hdfs.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"row batch-schedule-widget align-items-center m-0 my-4 p-3\"><div class=\"col-xl-4 col-lg-4 col-md-4 col-12\"> \r\n<img decoding=\"async\" src=\"https:\/\/www.acte.in\/wp-content\/uploads\/2020\/08\/Site-images-02-1.png\" alt=\"Course Curriculum\"><\/div>\r\n<div class=\"col-xl-8 col-lg-8 col-md-8 col-12 course-details-section\"><h3>Learn On-Demand Apache Spark and Scala Certification Training from Real Time Experts <\/h3>\r\n<span class=\"batch-week\">Weekday \/ Weekend Batches<\/span><a href=\"https:\/\/www.learnovita.com\/apache-spark-with-scala-training\">See Batch Details<\/a> <\/div><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 1:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To read a text file named \u201crecent_orders\u201d that exists in hdfs.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val ordersRDD = sc.textFile(\u201crecent_orders\u201d)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 2:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To read a text file named \u201crecent_orders\u201d that exists in hdfs and specify the number of partitions (3 partitions in this case).<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val ordersRDD = sc.textFile(\u201crecent_orders\u201d, 3)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 3:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To read all the contents of a directory named \u201cdata_files\u201d in hdfs.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val dataFilesRDD = sc.wholeTextFiles(\u201cdata_files\u201d)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p>Note: The RDD returned is in a key,value pair format where the key represents the path of each file, and the value represents the entire contents of the file.<\/p>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Spark filter example<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>A filter is a transformation operation in Apache Spark, which takes an existing dataset,applies a reducing function and returns data for which the reducing function returns a true boolean. Conceptually, this is similar to applying a column filter in an excel spreadsheet, or a \u201cwhere\u201d clause in a sql statement.<\/li><\/ul>\r\n\r\n\r\n\r\n<p>Listed below are a few Spark filter examples<\/p>\r\n\r\n\r\n\r\n<p>Prerequisite : Create an RDD with the sample data as shown below.&nbsp;<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val sampleColorRDD = sc.parallelize(List(\u201cred\u201d, \u201cblue\u201d, \u201cgreen\u201d, \u201cpurple\u201d, \u201cblue\u201d, \u201cyellow\u201d))<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 1:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To apply a filter on sampleColorRDD and only select the color \u201cblue\u201d from the RDD dataset.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val filterBlueRDD = sampleColorRDD.filter(color =&gt; color == \u201cblue\u201d)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 2:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To apply a filter on sampleColorRDD and select all colors other than the color \u201cblue\u201d from the RDD dataset.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val filterNotBlueRDD = sampleColorRDD.filter(color =&gt; color != \u201cblue\u201d)<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Example 3:<\/h3><\/p>\r\n\r\n\r\n\r\n<p>To apply a filter on sampleColorRDD and select multiple colors: red and \u201cblue\u201d from the RDD dataset.<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; val filterMultipleRDD = sampleColorRDD.filter(color =&gt; (color == \u201cblue\u201d || color == \u201cred\u201d))<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p>Note1: To perform a count() action on the filter output and validate, type the below at the command line:<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; filterMultipleRDD.count()<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p>Note2: Once you get familiar with the basics, you could minimize your code by combining transformation and action operations into a single line as such:<\/p>\r\n\r\n\r\n\r\n<div class=\"code-injector\"><ul class=\"wp-block-list\"><li>scala &gt; sampleColorRDD.filter(color =&gt; (color == \u201cblue\u201d || color == \u201cred\u201d)).count()<\/li><\/ul><\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Uses of spark and scala<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Frontend web development with ScalaJS<\/li><li>Mobile development, both Android Development and IOS \u2013 with Scala Native<\/li><li>Server-side libraries like HTTP4S, Akka-Http, Play Framework<\/li><li>Internet of things using<\/li><li>Game development<\/li><li>NLP \u2013 Natural Language Processing using a suite of libraries ScalaNLP<\/li><li>Testing advanced programming techniques such as Functional Programming and in Object-Oriented Programming<\/li><li>Build highly concurrent communication application using actors a library for the JVM inspired by Erlang<\/li><li>Use it for machine learning using libraries like Figaro that does probabilistic programming and Apache Spark that<\/li><li>To perform batch processing, we were using Hadoop MapReduce.<\/li><li>Also, to perform stream processing, we were using Apache Storm \/ S4.<\/li><li>Moreover, for interactive processing, we were using Apache Impala \/ Apache Tez.<\/li><li>To perform graph processing, we were using Neo4j \/ Apache Giraph.<\/li><\/ul>\r\n\r\n\r\n\r\n<div class=\"course-objectives request-call d-flex align-items-center justify-content-between\"> \r\n<strong>Apache Spark Sample Resumes! Download &amp; Edit, Get Noticed by Top Employers!<\/strong> \r\n<a class=\"btn btn-primary sample-resume btn-orange btn-orange-outline btn-sm\" href=\"https:\/\/www.learnovita.com\/apache-spark-sample-resumes\">Download<\/a> \r\n <\/div>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">Benefits&nbsp;<\/h3><\/p>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">1) Ideal for Implementing IoT<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>If your company is focusing on the Internet of Things, Spark can drive it through its capability of handling many analytics tasks concurrently. This is accomplished through well-developed libraries for ML, advanced algorithms for analyzing graphs, and in-memory processing of data at low latency.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">2) Helps in Optimizing Business Decision Making<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Low latency data transmitted by IoT sensors can be analysed as continuous streams by Spark. Dashboards that capture and display data in real time can be created for exploring improvement avenues.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">3) Complex Workflows Can Be Created with Ease<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Spark has dedicated high-level libraries for analyzing graphs, creating queries in SQL, ML, and data streaming. As such, you can create complex big data analytical workflows with ease through minimal coding.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">4) Prototyping Solutions Becomes Easier<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>As a Data Scientist, you can utilize Scala\u2019s ease of programming and Spark\u2019s framework for creating prototype solutions that offer enlightening insights into the analytical model.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">5) Helps in De-Centralized Processing of Data<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>In the coming decade, Fog computing will gain steam and will complement IoT to facilitate de-centralized processing of data. By learning Spark, you can remain prepared for upcoming technologies where large volumes of distributed data will need to be analyzed. You can also devise elegant IoT driven applications to streamline business functions.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">6) Compatibility with Hadoop<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Spark can function atop HDFS (Hadoop Distributed File System) and can complement Hadoop. Your organization need not spend additionally on setting up Spark infrastructure if Hadoop cluster is present. In a cost-effective manner, Spark can be deployed on Hadoop\u2019s data and cluster.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">7) Versatile Framework<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>Spark is compatible with multiple programming languages such as R, Java, Python, etc. This implies that Spark can be used for building Agile applications easily with minimal coding. The Spark and Scala online community is very vibrant with numerous programmers contributing to it. You can get all the required resources from the community for driving your plans.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">8) Faster Than Hadoop<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>If your organization is looking to enhance data processing speeds for making faster decisions, Spark can definitely offer a leading edge. Data is processed in Spark in a cyclic manner and the execution engine shares data in-memory. Support for Directed Acyclic Graph (DAG) mechanism allows Spark engine to process simultaneous jobs with the same datasets. Data is processed by Spark engine 100x quicker compared to Hadoop MapReduce.<\/li><\/ul>\r\n\r\n\r\n\r\n<p><h3 class=\"blog-title-4\">9) Proficiency Enhancer<\/h3><\/p>\r\n\r\n\r\n\r\n<ul class=\"doublearrow-list wp-block-list\"><li>If you learn Spark and Scala, you can become proficient in leveraging the power of different data structures as Spark is capable of accessing Tachyon, Hive, HBase, Hadoop, Cassandra, and others. Spark can be deployed over YARN or another distributed framework as well as on a standalone server.<\/li><\/ul>\r\n","protected":false},"excerpt":{"rendered":"<p>What is Apache Spark? Apache Spark is an open-source cluster computing framework that was initially developed at UC Berkeley in the AMPLab. As compared to the disk-based, two-stage MapReduce of Hadoop, Spark provides up to 100 times faster performance for a few applications with in-memory primitives. This makes it suitable for machine learning algorithms, as [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":17442,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[25,7,9],"tags":[22],"class_list":["post-14435","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-big-data","category-blog","category-tutorials","tag-tutorials","entry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Spark &amp; Scala Tutorial - LearnoVita<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Spark &amp; Scala Tutorial - LearnoVita\" \/>\n<meta property=\"og:description\" content=\"What is Apache Spark? Apache Spark is an open-source cluster computing framework that was initially developed at UC Berkeley in the AMPLab. As compared to the disk-based, two-stage MapReduce of Hadoop, Spark provides up to 100 times faster performance for a few applications with in-memory primitives. This makes it suitable for machine learning algorithms, as [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial\" \/>\n<meta property=\"og:site_name\" content=\"LearnoVita\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-12T05:33:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-09T05:15:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png\" \/>\n\t<meta property=\"og:image:width\" content=\"826\" \/>\n\t<meta property=\"og:image:height\" content=\"453\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#\\\/schema\\\/person\\\/c31d589dab256fcf0a6662ef7df42b60\"},\"headline\":\"Apache Spark &#038; Scala Tutorial\",\"datePublished\":\"2020-10-12T05:33:35+00:00\",\"dateModified\":\"2025-04-09T05:15:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial\"},\"wordCount\":2283,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Apache-Spark-Scala-Tutorial.png\",\"keywords\":[\"Tutorials\"],\"articleSection\":[\"Big Data\",\"Blog\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial\",\"url\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial\",\"name\":\"Apache Spark & Scala Tutorial - LearnoVita\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Apache-Spark-Scala-Tutorial.png\",\"datePublished\":\"2020-10-12T05:33:35+00:00\",\"dateModified\":\"2025-04-09T05:15:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#primaryimage\",\"url\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Apache-Spark-Scala-Tutorial.png\",\"contentUrl\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Apache-Spark-Scala-Tutorial.png\",\"width\":826,\"height\":453,\"caption\":\"Apache Spark & Scala Tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/apache-spark-scala-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.learnovita.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Spark &#038; Scala Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#website\",\"url\":\"https:\\\/\\\/www.learnovita.com\\\/\",\"name\":\"LearnoVita\",\"description\":\"Leading Online Training &amp; Certification Course Platform\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.learnovita.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#organization\",\"name\":\"LearnoVita\",\"url\":\"https:\\\/\\\/www.learnovita.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/cropped-Learnovita-Fav-Icon.png\",\"contentUrl\":\"https:\\\/\\\/www.learnovita.com\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/cropped-Learnovita-Fav-Icon.png\",\"width\":512,\"height\":512,\"caption\":\"LearnoVita\"},\"image\":{\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.learnovita.com\\\/#\\\/schema\\\/person\\\/c31d589dab256fcf0a6662ef7df42b60\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/3.7.42.173\"],\"url\":\"https:\\\/\\\/www.learnovita.com\\\/author\\\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Spark & Scala Tutorial - LearnoVita","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial","og_locale":"en_US","og_type":"article","og_title":"Apache Spark & Scala Tutorial - LearnoVita","og_description":"What is Apache Spark? Apache Spark is an open-source cluster computing framework that was initially developed at UC Berkeley in the AMPLab. As compared to the disk-based, two-stage MapReduce of Hadoop, Spark provides up to 100 times faster performance for a few applications with in-memory primitives. This makes it suitable for machine learning algorithms, as [&hellip;]","og_url":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial","og_site_name":"LearnoVita","article_published_time":"2020-10-12T05:33:35+00:00","article_modified_time":"2025-04-09T05:15:43+00:00","og_image":[{"width":826,"height":453,"url":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#article","isPartOf":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial"},"author":{"name":"admin","@id":"https:\/\/www.learnovita.com\/#\/schema\/person\/c31d589dab256fcf0a6662ef7df42b60"},"headline":"Apache Spark &#038; Scala Tutorial","datePublished":"2020-10-12T05:33:35+00:00","dateModified":"2025-04-09T05:15:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial"},"wordCount":2283,"commentCount":0,"publisher":{"@id":"https:\/\/www.learnovita.com\/#organization"},"image":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png","keywords":["Tutorials"],"articleSection":["Big Data","Blog","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial","url":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial","name":"Apache Spark & Scala Tutorial - LearnoVita","isPartOf":{"@id":"https:\/\/www.learnovita.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#primaryimage"},"image":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png","datePublished":"2020-10-12T05:33:35+00:00","dateModified":"2025-04-09T05:15:43+00:00","breadcrumb":{"@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.learnovita.com\/apache-spark-scala-tutorial"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#primaryimage","url":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png","contentUrl":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/10\/Apache-Spark-Scala-Tutorial.png","width":826,"height":453,"caption":"Apache Spark & Scala Tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/www.learnovita.com\/apache-spark-scala-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.learnovita.com\/"},{"@type":"ListItem","position":2,"name":"Apache Spark &#038; Scala Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.learnovita.com\/#website","url":"https:\/\/www.learnovita.com\/","name":"LearnoVita","description":"Leading Online Training &amp; Certification Course Platform","publisher":{"@id":"https:\/\/www.learnovita.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.learnovita.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.learnovita.com\/#organization","name":"LearnoVita","url":"https:\/\/www.learnovita.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.learnovita.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/09\/cropped-Learnovita-Fav-Icon.png","contentUrl":"https:\/\/www.learnovita.com\/wp-content\/uploads\/2020\/09\/cropped-Learnovita-Fav-Icon.png","width":512,"height":512,"caption":"LearnoVita"},"image":{"@id":"https:\/\/www.learnovita.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.learnovita.com\/#\/schema\/person\/c31d589dab256fcf0a6662ef7df42b60","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0deafe61159ec89baffea220bf73ea32e2cfb82fb2d3d74092426f36f8d2ca62?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/3.7.42.173"],"url":"https:\/\/www.learnovita.com\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/posts\/14435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/comments?post=14435"}],"version-history":[{"count":0,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/posts\/14435\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/media\/17442"}],"wp:attachment":[{"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/media?parent=14435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/categories?post=14435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnovita.com\/wp-json\/wp\/v2\/tags?post=14435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}