From ae2b47b29d84bd10839d855f3a52747eb3fe99f4 Mon Sep 17 00:00:00 2001 From: Claudio Atzori Date: Fri, 9 Jul 2021 15:47:51 +0200 Subject: [PATCH] [broker] added coalesce(1) on the stats dataset before storing it on postgres --- .../src/main/java/eu/dnetlib/dhp/broker/oa/GenerateStatsJob.java | 1 + 1 file changed, 1 insertion(+) diff --git a/dhp-workflows/dhp-broker-events/src/main/java/eu/dnetlib/dhp/broker/oa/GenerateStatsJob.java b/dhp-workflows/dhp-broker-events/src/main/java/eu/dnetlib/dhp/broker/oa/GenerateStatsJob.java index a4fb20b1c..9927d6560 100644 --- a/dhp-workflows/dhp-broker-events/src/main/java/eu/dnetlib/dhp/broker/oa/GenerateStatsJob.java +++ b/dhp-workflows/dhp-broker-events/src/main/java/eu/dnetlib/dhp/broker/oa/GenerateStatsJob.java @@ -80,6 +80,7 @@ public class GenerateStatsJob { .map( (MapFunction, DatasourceStats>) t -> t._2, Encoders.bean(DatasourceStats.class)) + .coalesce(1) .write() .mode(SaveMode.Overwrite) .jdbc(dbUrl, "oa_datasource_stats_temp", connectionProperties);