Lab_Exam 2021BCS0021
Lab_Exam 2021BCS0021
Group A
Time : 12PM – 2PM 30min time for writing, 1hr for execution
• Self-Join on File 1
• Inner join
• Outer join (Left, Right, Full)
File 1
customers.txt
1,Ramesh,32,Ahmedabad,2000.00
2,Khilan,25,Delhi,1500.00
3,kaushik,23,Kota,2000.00
4,Chaitali,25,Mumbai,6500.00
5,Hardik,27,Bhopal,8500.00
6,Komal,22,MP,4500.00
7,Muffy,24,Indore,10000.00
File 2
00:00:00,3,3000
100,2009-10-08 00:00:00,3,1500
101,2009-11-20 00:00:00,2,1560
103,2008-05-20 00:00:00,4,2060
SELF_JOIN
INNER JOIN
employee.txt
1,Rajiv,Reddy,21,programmer,113
2,Siddarth,Battacharya,22,programmer,113
3,Rajesh,Khanna,22,programmer,113
4,Preethi,Agarwal,21,programmer,113
5,Trupthi,Mohanthy,23,programmer,113
6,Archana,Mishra,23,programmer,113
7,Komal,Nayak,24,teamlead,112
employee_contact.txt
1,9848022337,[email protected],Hyderabad,113
2,9848022338,[email protected],Kolkata,113
3,9848022339,[email protected],Delhi,113
004,9848022330,[email protected],Pune,113
005,9848022336,[email protected],Bhuwaneshwar,11
3
006,9848022335,[email protected],Chennai,113
007,9848022334,[email protected],trivendram,112
008,9848022333,[email protected],Chennai,111
Task 3: Read any text file in Spark and display count of each word of the text file in
Spark. (3M)
Task 4: Read any csv file in Spark and show its all contents (1M)