From 5022f1b50d41080764fde22a74e3c581896e7dba Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 1 Apr 2021 18:16:40 +0200 Subject: [PATCH] removing organization deletedbyinference from the dump --- .../dnetlib/dhp/oa/graph/dump/complete/DumpGraphEntities.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/complete/DumpGraphEntities.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/complete/DumpGraphEntities.java index 36ced3a4ab..d2bb269064 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/complete/DumpGraphEntities.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/complete/DumpGraphEntities.java @@ -453,6 +453,7 @@ public class DumpGraphEntities implements Serializable { .map( (MapFunction) o -> mapOrganization((eu.dnetlib.dhp.schema.oaf.Organization) o), Encoders.bean(Organization.class)) + .filter(Objects::nonNull) .write() .mode(SaveMode.Overwrite) .option("compression", "gzip") @@ -460,6 +461,9 @@ public class DumpGraphEntities implements Serializable { } private static Organization mapOrganization(eu.dnetlib.dhp.schema.oaf.Organization org) { + if (org.getDataInfo().getDeletedbyinference()) + return null; + Organization organization = new Organization(); Optional