removing organization deletedbyinference from the dump

This commit is contained in:
Miriam Baglioni 2021-04-01 18:16:40 +02:00
parent 0421f5e1d8
commit 5022f1b50d
1 changed files with 4 additions and 0 deletions

View File

@ -453,6 +453,7 @@ public class DumpGraphEntities implements Serializable {
.map(
(MapFunction<E, Organization>) 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