diff --git a/docs/quick-start.md b/docs/quick-start.md index 07c520cbee6be..50a72861f95da 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -223,16 +223,14 @@ named `SimpleApp.scala`: /* SimpleApp.scala */ import org.apache.spark.sql.SparkSession -object SimpleApp { - def main(args: Array[String]) { - val logFile = "YOUR_SPARK_HOME/README.md" // Should be some file on your system - val spark = SparkSession.builder.appName("Simple Application").getOrCreate() - val logData = spark.read.textFile(logFile).cache() - val numAs = logData.filter(line => line.contains("a")).count() - val numBs = logData.filter(line => line.contains("b")).count() - println(s"Lines with a: $numAs, Lines with b: $numBs") - spark.stop() - } +object SimpleApp extends App { + val logFile = "YOUR_SPARK_HOME/README.md" // Should be some file on your system + val spark = SparkSession.builder.appName("Simple Application").getOrCreate() + val logData = spark.read.textFile(logFile).cache() + val numAs = logData.filter(line => line.contains("a")).count() + val numBs = logData.filter(line => line.contains("b")).count() + println(s"Lines with a: $numAs, Lines with b: $numBs") + spark.stop() } {% endhighlight %}