- STRING INTERPOLATION, https://docs.scala-lang.org/overviews/core/string-interpolation.html
s"Hello, ${name}"
"%s %s, age %d".format(firstName, lastName, age)
f"${row.getString(0)} $name is $age years old, and weighs $weight%.0f pounds."
- A general overview of Scala, http://allaboutscala.com/
- How To Use If Else Statement And Expression, http://allaboutscala.com/tutorials/chapter-2-learning-basics-scala-programming/scala-tutorial-use-if-else-statement-expression/
val numberOfDonutsToBuy = if(numberOfPeople > 10) (numberOfPeople * donutsPerPerson) else defaultDonutsToBuy
- Using StackOverflow dataset
- Add Apache Spark 2 SBT dependencies
- Bootstrap a SparkSession
- DataFrame Introduction
- Create DataFrame from a CSV file
- DataFrame schema
- Select columns
- Filter by column value
- Count rows
- SQL like
- Filter chaining
- SQL In
- SQL Group By
for ( i <- 1 to 3) { println("Ho " + i) }
val result = for ( i <- 1 to 10 ) yield i + 2
- https://alvinalexander.com/scala/
- How to prompt users for input from Scala shell scripts, https://alvinalexander.com/scala/scala-shell-scripts-how-prompt-users-input-read
- The Scala ternary operator syntax, https://alvinalexander.com/scala/scala-ternary-operator-syntax
val a = if (i == 1) x else y
- Scala中的None,Nothing,Null,Nil, https://blog.csdn.net/bluejoe2000/article/details/30465175