Built with Tutify.io

    AIStudyLabs

    Run Spark First Program

    Run Spark First Program

    Spark GitHub Clone – Hello World Example Project

    To make things simple, I have created a Spark Hello World project in GitHub, I will use this to run the example. First let’s clone the project, build, and run.

    Using this option, we are going to import the project directly from the GitHub repository.

    Once the cloning completes, you will see the project workspace structure on IntelliJ.

    4. Run Maven build

    Now run the Maven build. First, select the Maven from the right corner, navigate to Lifecycle > install, right-click, and select Run Maven Build.

    This downloads all dependencies mentioned in the pom.xml file and compiles all examples in this tutorial. This also takes a few mins to complete and you should see the below message after a successful build.

    5. Run Hello World Spark Program

    After a successful Maven build, run src/main/scala/com.aistudylabs.spark.SparkSessionTest

    In case you still get errors during the running of the Spark application, please restart the IntelliJ IDE and run the application again.

    Summary

    This lesson guides learners through cloning a Spark Hello World project from GitHub, setting it up in IntelliJ, running a Maven build to install dependencies, and executing a basic Spark program.

    Apache Spark Tutorial with Java Examples — Setup Apache Spark Environment

    Introduction to Apache Spark

    Setup Apache Spark Environment

    SparkSession & SparkContext

    Resilient Distributed Datasets (RDDs)

    Cache, Persistence and Shared Variables

    DataFrame Introduction

    DataFrame Narrow Transformation

    DataFrame Wider Transformation

    DataFrame Actions

    Spark SQL Functions

    Advanced DataFrame Features

    Using SQL Queries

    Spark Read & Write CSV Files

    Working with JSON Files

    Working with Parquet Files

    Spark Dataset

    What Next?

    Tutorial Not Found