Check out example codes for "scala cheat sheet". It will help you in understanding the concepts better.

Code Example 1

import org.apache.spark.sql.functions._
import org.apache.spark.sql.SparkSession

val spark = SparkSession
  .builder
  .appName("StructuredNetworkWordCount")
  .getOrCreate()
  
import spark.implicits._

Learn ReactJs, React Native from akashmittal.com