14. [Activity] Running the Average Friends by Age Example
Activity
For this activity, you will be looking at fakefriends.csv from the resource folder
Copy fakefriends.csv into SparkScala folder
Open Scala IDE and go to SparkScalaCourse and import the file FriendsByAge.scala
Open up the file FriendsByAge.scala and it is the codes that we talked about in the previous lecture
To run the file, right click and select Run configurations
Choose Scala Application and select New to create new configuration and name it FriendsByAge
Choose the Main Class to be com.sundogsoftware.spark.FriendsByAge and select apply and run
Now you should able to see the output for the average for each of the age
Exercise
I have changed and created a new file FriendsByFirstName.scala to sort average friends by first name based on fakefriends.csv data
Last updated