I am trying to write a test case for Map Reduce program which has 2 mappers and one reducer using MultipleInputsMapReduceDriver. In Maven I tried testing the following code but got an error saying: "No Inputs was given to SecondMapper". Help me with the code.
@Test
public testMapReduceDriver() throws IOException,
InterruptedException {
Text value1 = new Text("wds,sd,Male,Divorce,8-5-2000");
Text value2 = new Text("as,wds,asd,2.3,Cas,1/2/2011");
Text value3 = new Text("ds,wds,assad,4.3,Cash,2/1/2019");
new MultipleInputsMapReduceDriver<Text, Text, Text, Text>()
.withMapper(new FirstMapper())
.withMapper(new SecondMapper())
.withReducer(new SingleReducer())
.withAll(new FirstMapper(), Arrays.asList((new Pair<LongWritable, Text>(new LongWritable(0), value1))))
.withAll(new SecondMapper(), Arrays.asList((new Pair<LongWritable, Text>(new LongWritable(20), value2)),
(new Pair<LongWritable, Text>(new LongWritable(10), value3))))
.withAllOutput(Arrays.asList(new Pair<Text,Text>(new Text("Male"),new Text("6.6"))))
.runTest();
}
question from:
https://stackoverflow.com/questions/65862463/how-to-write-test-cases-for-reduce-side-join-problems-multiple-mappers-and-sing 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…