chenged the xquery for the cfhb table

This commit is contained in:
Miriam Baglioni 2020-05-07 09:58:17 +02:00
parent 42ad51577a
commit 5a476c7a13
1 changed files with 10 additions and 5 deletions

View File

@ -157,11 +157,16 @@ public class PropagationConstant {
public static void createCfHbforresult(SparkSession spark) { public static void createCfHbforresult(SparkSession spark) {
String query; String query;
query = "SELECT id, inst.collectedfrom.key cf , inst.hostedby.key hb " // query = "SELECT id, inst.collectedfrom.key cf , inst.hostedby.key hb "
+ "FROM ( SELECT id, instance " // + "FROM ( SELECT id, instance "
+ "FROM result " // + "FROM result "
+ " WHERE datainfo.deletedbyinference = false) ds " // + " WHERE datainfo.deletedbyinference = false) ds "
+ "LATERAL VIEW EXPLODE(instance) i AS inst"; // + "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<Row> cfhb = spark.sql(query); org.apache.spark.sql.Dataset<Row> cfhb = spark.sql(query);
cfhb.createOrReplaceTempView("cfhb"); cfhb.createOrReplaceTempView("cfhb");
} }