Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. String jsonFilePath = "/home/vipin/workspace/Smarten/jsonParsing/Employee/Employee-01.json,/home/vipin/workspace/Smarten/jsonParsing/Employee/Employee-02.json";
  2.  
  3. String[] jsonFiles = jsonFilePath.split(",");
  4.  
  5. Dataset<Row> people = sparkSession.read().json(jsonFiles);
  6. people.show(50, false);
  7.  
  8. {
  9. "Name":"Vipin Suman",
  10. "Email":"vpn2330@gmail.com",
  11. "Designation":"Trainee Programmer",
  12. "Age":22 ,
  13. "location":
  14. {
  15. "City":"Ahmedabad",
  16. "State":"Gujarat"
  17. }
  18. }
  19.  
  20.  
  21.  
  22. Age | Designation | Email | Name | Location
  23. ------------------------------------------------------------
  24. 22 |Programmer |vpn2330@gmail.com | Vipin Suman|[Ahmedabad,Gujarat]
  25.  
  26. Age | Designation | Email | Name | City | State
  27. ------------------------------------------------------------
  28. 22 |Programmer |vpn2330@gmail.com | Vipin Suman| Ahmedabad |Gujarat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement