From 5a476c7a13d697d6d5b717df7fe0154505603e9e Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 7 May 2020 09:58:17 +0200 Subject: [PATCH] chenged the xquery for the cfhb table --- .../java/eu/dnetlib/dhp/PropagationConstant.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/PropagationConstant.java b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/PropagationConstant.java index 5bab36a5f..ebd25fa35 100644 --- a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/PropagationConstant.java +++ b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/PropagationConstant.java @@ -157,11 +157,16 @@ public class PropagationConstant { public static void createCfHbforresult(SparkSession spark) { String query; - query = "SELECT id, inst.collectedfrom.key cf , inst.hostedby.key hb " - + "FROM ( SELECT id, instance " - + "FROM result " - + " WHERE datainfo.deletedbyinference = false) ds " - + "LATERAL VIEW EXPLODE(instance) i AS inst"; +// query = "SELECT id, inst.collectedfrom.key cf , inst.hostedby.key hb " +// + "FROM ( SELECT id, instance " +// + "FROM result " +// + " WHERE datainfo.deletedbyinference = false) ds " +// + "LATERAL VIEW EXPLODE(instance) i AS inst"; + query = "select distinct r.id, inst.collectedfrom.key cf, inst.hostedby.key hb " + + "from result r " + + "lateral view explode(instance) i as inst " + + "where r.datainfo.deletedbyinference=false"; + org.apache.spark.sql.Dataset cfhb = spark.sql(query); cfhb.createOrReplaceTempView("cfhb"); }