use of org.apache.hadoop.mrunit.mapreduce.MapDriver in project incubator-rya by apache.
the class DuplicateEliminationTest method testTableMapperOutput.
@Test
public void testTableMapperOutput() throws Exception {
RyaStatement rya = TestUtils.ryaStatement("x", "subOrganizationOf", "y");
TripleRowResolver trr = new WholeRowTripleResolver();
Map<TABLE_LAYOUT, TripleRow> map = trr.serialize(rya);
TripleRow tr = map.get(TABLE_LAYOUT.SPO);
byte[] b = new byte[0];
Key key = new Key(tr.getRow(), tr.getColumnFamily(), tr.getColumnQualifier(), b, 1);
Value val = new Value(b);
new MapDriver<Key, Value, Fact, Derivation>().withMapper(new DuplicateElimination.DuplicateTableMapper()).withInput(key, val).withOutput(X_SUB_Y, X_SUB_Y.getDerivation()).runTest();
}
use of org.apache.hadoop.mrunit.mapreduce.MapDriver in project incubator-rya by apache.
the class DuplicateEliminationTest method testInconsistencyMapperOutput.
@Test
public void testInconsistencyMapperOutput() throws Exception {
Fact empty = new Fact();
empty.setDerivation(X_DISJOINT);
new MapDriver<Derivation, NullWritable, Fact, Derivation>().withMapper(new DuplicateElimination.InconsistencyMapper()).withInput(X_DISJOINT, NullWritable.get()).withOutput(empty, X_DISJOINT).runTest();
}
use of org.apache.hadoop.mrunit.mapreduce.MapDriver in project incubator-rya by apache.
the class JoinSelectStatisticsSumTest method testPartialTripleEntry.
@Test
public void testPartialTripleEntry() throws InterruptedException, IOException {
TripleEntry te1 = new TripleEntry(new Text("urn:gem:etype#1234"), new Text(""), new Text("subject"), new Text(""), new Text("object"));
CardList cl = new CardList(34, 52, 63, 0, 0, 0);
new MapDriver<TripleEntry, CardList, TripleEntry, CardList>().withMapper(new JoinSelectStatisticsSum.CardinalityIdentityMapper()).withInput(te1, cl).withOutput(te1, cl).runTest();
}
use of org.apache.hadoop.mrunit.mapreduce.MapDriver in project incubator-rya by apache.
the class JoinSelectStatisticsSumTest method testFullTripleEntry.
@Test
public void testFullTripleEntry() throws InterruptedException, IOException {
TripleEntry te1 = new TripleEntry(new Text("urn:gem:etype#1234"), new Text("urn:gem#pred"), new Text("subject"), new Text("predicate"), new Text("object"));
CardList cl = new CardList(34, 52, 63, 0, 0, 0);
TripleEntry te2 = new TripleEntry(new Text("urn:gem:etype#1234"), new Text(""), new Text("subject"), new Text(""), new Text("object"));
TripleEntry te3 = new TripleEntry(new Text("urn:gem#pred"), new Text(""), new Text("predicate"), new Text(""), new Text("object"));
new MapDriver<TripleEntry, CardList, TripleEntry, CardList>().withMapper(new JoinSelectStatisticsSum.CardinalityIdentityMapper()).withInput(te1, cl).withOutput(te2, cl).withOutput(te3, cl).withOutput(te1, cl).runTest();
}
Aggregations