1
0
Fork 0
This commit is contained in:
Miriam Baglioni 2020-02-28 18:24:39 +01:00
parent b098ee0bae
commit 550cb21c23
1 changed files with 3 additions and 5 deletions

View File

@ -48,11 +48,7 @@ public class SparkResultToProjectThroughSemRelJob {
JavaRDD<Relation> relations = sc.sequenceFile(inputPath + "/relation", Text.class, Text.class) JavaRDD<Relation> relations = sc.sequenceFile(inputPath + "/relation", Text.class, Text.class)
.map(item -> new ObjectMapper().readValue(item._2().toString(), Relation.class)).cache(); .map(item -> new ObjectMapper().readValue(item._2().toString(), Relation.class)).cache();
JavaPairRDD<String, TypedRow> result_result = relations JavaPairRDD<String, TypedRow> result_result = getResultResultSemRel(allowedsemrel, relations);
.filter(r -> !r.getDataInfo().getDeletedbyinference())
.filter(r -> allowedsemrel.contains(r.getRelClass()) && RELATION_RESULTRESULT_REL_TYPE.equals(r.getRelType()))
.map(r -> new TypedRow().setSourceId(r.getSource()).setTargetId(r.getTarget()))
.mapToPair(toPair());
JavaPairRDD<String, TypedRow> result_project = relations JavaPairRDD<String, TypedRow> result_project = relations
.filter(r -> !r.getDataInfo().getDeletedbyinference()) .filter(r -> !r.getDataInfo().getDeletedbyinference())
@ -117,4 +113,6 @@ public class SparkResultToProjectThroughSemRelJob {
} }
} }