code formatter

This commit is contained in:
Sandro La Bruzzo 2022-04-22 11:08:13 +02:00
parent aa12429f50
commit a82ec3aaaf
1 changed files with 6 additions and 12 deletions

View File

@ -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")
}
}
}