Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. REGISTER /usr/hdp/current/pig-client/piggybank.jar;
  2.  
  3.  
  4. lifes = LOAD 'labs/hadoop/pig/Life_Expectancy_Data.csv' USING org.apache.pig.piggybank.storage.CSVExcelStorage() as (
  5. country:chararray,
  6. year:int,
  7. status:chararray,
  8. life_expectancy:double,
  9. adult_mortality:int,
  10. infant_deaths:int,
  11. alcohol:double,
  12. percentage_expenditure:double,
  13. hepatitis_b:int,
  14. measles:int,
  15. BMI:double,
  16. under_five_deaths:int,
  17. polio:int,
  18. total_expenditure:double,
  19. diphtheria:int,
  20. HIV_AIDS:double,
  21. GDP:double,
  22. Population:int,
  23. thinness_1_19_years:double,
  24. thinness_5_9_years:double,
  25. income_composition_of_resources:double,
  26. schooling:double);
  27.  
  28. ranked_lifes = RANK lifes;
  29.  
  30.  
  31. res = ORDER ranked_lifes BY life_expectancy DESC;
  32. res = LIMIT res 3;
  33.  
  34. DUMP res;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement