forked from D-Net/dnet-hadoop
[Enrichment Step] issue of NPE on author should be fixed
This commit is contained in:
parent
550e1a4e33
commit
d205bf78d8
|
@ -121,9 +121,13 @@ public class PrepareResultOrcidAssociationStep1 {
|
|||
readPath(spark, inputResultPath, resultClazz)
|
||||
.filter(
|
||||
(FilterFunction<R>) r -> !r.getDataInfo().getDeletedbyinference() && !r.getDataInfo().getInvisible())
|
||||
.filter((FilterFunction<R>) r ->
|
||||
Optional.ofNullable(r.getAuthor())
|
||||
.map(al -> al.stream().anyMatch(
|
||||
.filter(
|
||||
(FilterFunction<R>) r -> Optional
|
||||
.ofNullable(r.getAuthor())
|
||||
.map(
|
||||
al -> al
|
||||
.stream()
|
||||
.anyMatch(
|
||||
a -> hasAllowedPid(a, allowedPids)))
|
||||
.orElse(false)
|
||||
|
||||
|
@ -133,7 +137,6 @@ public class PrepareResultOrcidAssociationStep1 {
|
|||
.option("compression", "gzip")
|
||||
.json(outputPath + "/resultSubset");
|
||||
|
||||
|
||||
Dataset<R> result = readPath(spark, outputPath + "/resultSubset", resultClazz);
|
||||
|
||||
result.foreach((ForeachFunction<R>) r -> System.out.println(new ObjectMapper().writeValueAsString(r)));
|
||||
|
|
Loading…
Reference in New Issue