From 316d585c8a4f6cd7dbd2b7b69a6e5e7b8bd3ccef Mon Sep 17 00:00:00 2001 From: Antonis Lempesis Date: Thu, 7 Mar 2024 02:07:59 +0200 Subject: [PATCH] using distinct apcs per publication to avoid huge sums --- .../dnetlib/dhp/oa/graph/stats/oozie_app/scripts/step15_5.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-stats-update/src/main/resources/eu/dnetlib/dhp/oa/graph/stats/oozie_app/scripts/step15_5.sql b/dhp-workflows/dhp-stats-update/src/main/resources/eu/dnetlib/dhp/oa/graph/stats/oozie_app/scripts/step15_5.sql index 2c606fb928..c0f39aefb3 100644 --- a/dhp-workflows/dhp-stats-update/src/main/resources/eu/dnetlib/dhp/oa/graph/stats/oozie_app/scripts/step15_5.sql +++ b/dhp-workflows/dhp-stats-update/src/main/resources/eu/dnetlib/dhp/oa/graph/stats/oozie_app/scripts/step15_5.sql @@ -56,7 +56,7 @@ join ${stats_db_name}.result res on res.id=r.id; DROP TABLE IF EXISTS ${stats_db_name}.result_apc purge; create table if not exists ${stats_db_name}.result_apc STORED AS PARQUET as -select r.id, r.amount, r.currency +select distinct r.id, r.amount, r.currency from ( select substr(r.id, 4) as id, cast(inst.processingchargeamount.value as float) as amount, inst.processingchargecurrency.value as currency from ${openaire_db_name}.result r lateral view explode(r.instance) instances as inst) r