input: BX-Book-Ratings.csv Mapper - gets values of ISBN and BookRating and send it in reducer phase, key= ISBN and value= Ratings Reducer - get key & iterate it's value = get values and find average.
input: BX-Book-Ratings.csv and BX-Users.csv
Mapper1- Maps values from both the csv file. (by matching the pattern ".*\\d+.*") BX-Book-Ratings.csv: get userid, ISBN (key,value) BX-User.csv: get userid, location (key, value)
(one userid can reference multipe ISBNs, but single location)
Reducer-1 - create new key, from ISBN & userlocation, and its value part will contain user ids Mapper-2 - get the key and value, from reducer-1, Reducer-2 - get new key (ISBN+userlocation) and iterate its values.
each iterate will increment the count by 1, (for counting nuber of userids it has) (final output will contain ISBN+userlocation & usercounts)
this will indicate which ISBN is famous at which location.
Mapper - key: yearofpublish + publishername value: 1 Reducer - get key and iterate through values and sum the count.
input: BX-Book-Ratings and BX-Users
Mapper-1 - key: userID value: ISBN key: userID value: age
(one user ID can have multiple ISBN but single Age Value)
Reducer-1 - key: ISBN+agegroup value: 1 AGEGROUP:
if(age <= 19){ ageGroup = "Teenager"; } else if(age19 && age <=34){ ageGroup = "Millenial"; } else if(age34 && age <=50){ ageGroup = "GenX"; } else if(age50 && age <=69){ ageGroup = "Boomer"; } else{ ageGroup = "Silent"; }
Mapper-2 - key: ISBN+agegroup, value:1 Reducer-2 - get the key, iterate through values and sum count.
same as MR3 but here we are considering authors not publishers.
input: BX-Books.csv
Mapper - key: yearofpublish + author, value: 1 Reducer - get the key and iterate through value and sum count.
Mapper - key: year value: 1 Reducer - get the keys, iterate through values and do sum count.