diff --git a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/funderresults/SparkDumpFunderResults.java b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/funderresults/SparkDumpFunderResults.java index 261fb68bb1..b124b76ce0 100644 --- a/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/funderresults/SparkDumpFunderResults.java +++ b/dhp-workflows/dhp-graph-mapper/src/main/java/eu/dnetlib/dhp/oa/graph/dump/funderresults/SparkDumpFunderResults.java @@ -108,7 +108,7 @@ public class SparkDumpFunderResults implements Serializable { } - private static void dumpResults(String nsp, Dataset results, String outputPath, String funderName, String funderDump) { + private static void dumpResults(String nsp, Dataset results, String outputPath, String funderName) { results.map((MapFunction) r -> { if (!Optional.ofNullable(r.getProjects()).isPresent()) { @@ -117,7 +117,7 @@ public class SparkDumpFunderResults implements Serializable { for (Project p : r.getProjects()) { if (p.getId().startsWith(nsp)) { - if (nsp.equals("40|irb")) { + if (nsp.startsWith("40|irb")) { if (p.getFunder().getShortName().equals(funderName)) return r; else @@ -132,18 +132,18 @@ public class SparkDumpFunderResults implements Serializable { .write() .mode(SaveMode.Overwrite) .option("compression", "gzip") - .json(outputPath + "/" + funderDump); + .json(outputPath + "/" + funderName); } private static void writeFunderResult(String funder, Dataset results, String outputPath, String funderDump) { - if (funder.equals("40|irb")) { - dumpResults(funder, results, outputPath, "CSF", "HRZZ"); - dumpResults(funder, results, outputPath, "MSES", "MZOS"); + if (funder.startsWith("40|irb")) { + dumpResults(funder, results, outputPath, "HRZZ"); + dumpResults(funder, results, outputPath, "MZOS"); } else - dumpResults(funder, results, outputPath, funderDump, null); + dumpResults(funder, results, outputPath, funderDump); }