forked from D-Net/dnet-hadoop
This commit is contained in:
parent
c702f8e6a3
commit
cb3cb8df04
|
@ -73,13 +73,14 @@ public class PrepareResultsSparkJob implements Serializable {
|
||||||
|
|
||||||
result.createOrReplaceTempView("result");
|
result.createOrReplaceTempView("result");
|
||||||
|
|
||||||
String query = "select auth.name name, auth.surname surname, auth.fullname fullname, pIde.value orcid, id, cf.value collectedfrom "
|
String query = "select auth.name name, auth.surname surname, auth.fullname fullname, pIde.value orcid, id, " +
|
||||||
+
|
"collect_set(cf.value) as collectedfrom " +
|
||||||
"from result " +
|
"from result " +
|
||||||
"lateral view explode(author) a as auth " +
|
"lateral view explode(author) a as auth " +
|
||||||
"lateral view explode(auth.pid)p as pIde " +
|
"lateral view explode(auth.pid)p as pIde " +
|
||||||
"lateral view explode (collectedfrom) c as cf " +
|
"lateral view explode (collectedfrom) c as cf " +
|
||||||
"where pIde.qualifier.classid = 'orcid'";
|
"where pIde.qualifier.classid = 'orcid' " +
|
||||||
|
"group by auth.name, auth.surname, auth.fullname, pIde.value, id";
|
||||||
|
|
||||||
spark
|
spark
|
||||||
.sql(query)
|
.sql(query)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
package eu.dnetlib.dhp.oa.graph.clean.authorpids;
|
package eu.dnetlib.dhp.oa.graph.clean.authorpids;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ResultInfo implements Serializable {
|
public class ResultInfo implements Serializable {
|
||||||
private String id;
|
private String id;
|
||||||
|
@ -9,13 +10,13 @@ public class ResultInfo implements Serializable {
|
||||||
private String surname;
|
private String surname;
|
||||||
private String fullname;
|
private String fullname;
|
||||||
private String orcid;
|
private String orcid;
|
||||||
private String collectedfrom;
|
private List<String> collectedfrom;
|
||||||
|
|
||||||
public String getCollectedfrom() {
|
public List<String> getCollectedfrom() {
|
||||||
return collectedfrom;
|
return collectedfrom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCollectedfrom(String collectedfrom) {
|
public void setCollectedfrom(List<String> collectedfrom) {
|
||||||
this.collectedfrom = collectedfrom;
|
this.collectedfrom = collectedfrom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue