added collectedfrom information on record

This commit is contained in:
Miriam Baglioni 2020-11-09 16:07:17 +01:00
parent 0ef5e7dc34
commit 0f1a4f6637
2 changed files with 12 additions and 4 deletions

View File

@ -73,10 +73,12 @@ 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 " + String query = "select auth.name name, auth.surname surname, auth.fullname fullname, pIde.value orcid, id, cf.value 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 " +
"where pIde.qualifier.classid = 'orcid'"; "where pIde.qualifier.classid = 'orcid'";
spark spark

View File

@ -9,6 +9,15 @@ 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;
public String getCollectedfrom() {
return collectedfrom;
}
public void setCollectedfrom(String collectedfrom) {
this.collectedfrom = collectedfrom;
}
public String getId() { public String getId() {
return id; return id;
@ -50,7 +59,4 @@ public class ResultInfo implements Serializable {
this.orcid = orcid; this.orcid = orcid;
} }
public void removeOrcid() {
this.orcid = "";
}
} }