From 1361c9eb0c6c4f929eefaa071405d8e1d93ba202 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Thu, 7 Jan 2021 10:07:30 +0100 Subject: [PATCH] [BIP! Scores integration] Create updates as Result rather than subclasses; Result considers also metrics in the mergeFrom operation --- dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java | 2 +- .../dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java index 443c18230..0026ee9aa 100644 --- a/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java +++ b/dhp-schemas/src/main/java/eu/dnetlib/dhp/schema/oaf/Result.java @@ -243,7 +243,7 @@ public class Result extends OafEntity implements Serializable { Result r = (Result) e; - // TODO consider merging also Measures + measures = mergeLists(measures, r.getMeasures()); instance = mergeLists(instance, r.getInstance()); diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java index 50bda898c..dfe48542c 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java @@ -126,7 +126,7 @@ public class SparkAtomicActionScoreJob implements Serializable { }, Encoders.bean(BipScore.class)) .groupByKey((MapFunction) value -> value.getId(), Encoders.STRING()) .mapGroups((MapGroupsFunction) (k, it) -> { - Result ret = inputClazz.newInstance(); + Result ret = new Result(); BipScore first = it.next(); ret.setId(first.getId());