09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7

}

Analytics at Scale

{

ArrayList<String> vals = new

ArrayList<String>();

vals.add("1");

result.put(w, vals);

}

}

return result;

@Override

HashMap<String, ArrayList<String>> reducer_task

(String key, ArrayList<String> values) {

// TODO Auto-generated method stub

HashMap<String, ArrayList<String>> result = new

HashMap<String, ArrayList<String>>();

ArrayList<String> tempres = new

ArrayList<String>();

tempres.add(values.size()+ "");

result.put(key, tempres);

return result;

}

}

Here is the MainBDAS class:

import java.io.IOException;

import java.util.ArrayList;

import java.util.HashMap;

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.Path;

import org.apache.hadoop.io.LongWritable;

152

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!