Here is a simple example of how you can execute a function in Scala, for this you need to write one function in Scala shell below:
scala> println("Any text")
Here is a simple example solved with the output:
Hope it helps.
If you want to know more about Apache Spark Scala, It's highly recommended to go for Spark Certification Course today.