Spark Hello World with Gradle

less than 1 minute read

Prerequisites

  1. Scala - Basic
  2. Intellij IDE - Basic
  3. Gradle installed in your system
  4. Java 8 installed in your system

1. Create a gradle Project

  1. Create a Gradle Project using the intellij Idea new project.
  2. Create a new folder called src/main/scala
  3. Mark scala directory as source

2. Add the gradle dependencies

Add the following code in your build.gradle

3. Create a scala object

Create a scala object ApplicationMain.

4. Write the hello world code

Under your ApplicationMain object, create a main method and write the below code

5. Run the program locally

Run your spark application by right clicking the ApplicationMain and check the output in your console.

The code is available in Github