Dataframe creation commands:
![image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA2MTk2MjAzNywiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.yJZR7i7vNKnHBiT99ipX8dshdGHlAXATaxzh0bza89I)
Now we will register them as tempTables and will do sparksql:
![image](https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDA2MTk2MjA0NCwiZG9tYWluIjoiZWR1cmVrYS5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NDE0NTN9.1M5MUlngL748uVTO-Qq1xHu01agBVbO5n-9Qidh0YVE)
For loading file in comma delimited csv to a dataframe, please refer to the below command:
val df1 = sqlContext.read.format("csv").option("header", "true").option("delimiter", ",").option("inferschema", "false").load("stud.csv");