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

String line = value.toString();

HashMap<String, ArrayList<String>>

result = instance.mapper_task(line);

for(String k : result.keySet())

{

for(String v : result.get(k))

{

context.write(new

Text(k), new Text(v));

}

}

} catch (Exception e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

public static class ReducerBDAS extendsReducer<Text,

Text, Text, Text> {

protected void reduce(Text key, Iterable<Text>

values,

Context context) throws IOException,

InterruptedException {

String classname = context.

getConfiguration().get("classname");

try {

154

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

Saved successfully!

Ooh no, something went wrong!