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 id = splitarray[index2].trim();

String ids = "sec:" + line;

output.collect(new Text(id), new Text(ids));

////////////////////////////////////////////////////////////

@SuppressWarnings({ "deprecation", "rawtypes",

"unchecked" })

public static void main(String[] args)

throws IOException, ClassNotFoundException,

InterruptedException {

// TODO Auto-generated method stub

JobConf conf = new JobConf();

conf.set("index1", args[3]);

conf.set("index2", args[4]);

conf.setReducerClass(JoinReducer.class);

MultipleInputs.addInputPath(conf, new

Path(args[0]), TextInputFormat.class, (Class<?

extends org.apache.hadoop.mapred.Mapper>)

TransactionMapper.class);

MultipleInputs.addInputPath(conf, new

Path(args[1]), TextInputFormat.class, (Class<?

extends org.apache.hadoop.mapred.Mapper>)

SecondaryMapper.class);

Job job = new Job(conf);

job.setJarByClass(MapreduceJoin.class);

job.setJobName("MapReduceJoin");

job.setOutputKeyClass(Text.class);

165

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

Saved successfully!

Ooh no, something went wrong!