forked from D-Net/dnet-hadoop
Fix conditions that prevented ORCID Enrichment
This commit is contained in:
parent
9092075760
commit
0ff7faad72
|
@ -87,7 +87,7 @@ object ORCIDAuthorEnricher extends Serializable {
|
|||
) = {
|
||||
val matched = scala.collection.mutable.ArrayBuffer.empty[MatchedAuthors]
|
||||
|
||||
if (graph_authors != null && graph_authors.isEmpty) {
|
||||
if (graph_authors != null && !graph_authors.isEmpty) {
|
||||
val ait = graph_authors.iterator
|
||||
|
||||
while (ait.hasNext) {
|
||||
|
|
|
@ -72,7 +72,7 @@ class SparkEnrichGraphWithOrcidAuthors(propertyPath: String, args: Array[String]
|
|||
.join(matched, Seq("id"), "left")
|
||||
.withColumn(
|
||||
"author",
|
||||
when(size(col("enriched_author")).gt(1), col("enriched_author"))
|
||||
when(size(col("enriched_author")).gt(0), col("enriched_author"))
|
||||
.otherwise(col("author"))
|
||||
)
|
||||
.drop("enriched_author")
|
||||
|
|
Loading…
Reference in New Issue