From a82ec3aaaf60ea77918f3ff1cfab20538ef6fe7e Mon Sep 17 00:00:00 2001 From: Sandro La Bruzzo Date: Fri, 22 Apr 2022 11:08:13 +0200 Subject: [PATCH] code formatter --- .../doiboost/SparkGenerateDoiBoost.scala | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/SparkGenerateDoiBoost.scala b/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/SparkGenerateDoiBoost.scala index 10a5be969..2cbd53097 100644 --- a/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/SparkGenerateDoiBoost.scala +++ b/dhp-workflows/dhp-doiboost/src/main/scala/eu/dnetlib/doiboost/SparkGenerateDoiBoost.scala @@ -129,11 +129,9 @@ object SparkGenerateDoiBoost { .map(DoiBoostMappingUtil.fixPublication) .map(p => (p.getId, p)) .groupByKey(_._1) - .reduceGroups((left, right) => - { + .reduceGroups((left, right) => { //Check left is not null - if (left != null && left._1 != null) - { + if (left != null && left._1 != null) { //If right is null then return left if (right == null || right._2 == null) left @@ -151,21 +149,17 @@ object SparkGenerateDoiBoost { //Return publication Merged (b1.getId, b1) } - } - else { + } else { // Left is Null so we return right right } - } - - ) - .filter(s => s!= null && s._2!=null) + }) + .filter(s => s != null && s._2 != null) .map(s => s._2._2) .write .mode(SaveMode.Overwrite) .save(s"$workingDirPath/doiBoostPublicationFiltered") - val affiliationPath = parser.get("affiliationPath") val paperAffiliationPath = parser.get("paperAffiliationPath") @@ -290,4 +284,4 @@ object SparkGenerateDoiBoost { .save(s"$workingDirPath/doiBoostOrganization") } -} \ No newline at end of file +}