forked from D-Net/dnet-hadoop
restored some collab indicators
This commit is contained in:
parent
227e10f4b3
commit
fcef5294e2
|
@ -118,40 +118,40 @@ compute stats indi_funded_result_with_fundref;
|
||||||
--
|
--
|
||||||
-- compute stats indi_result_org_collab;
|
-- compute stats indi_result_org_collab;
|
||||||
--
|
--
|
||||||
-- create table indi_project_collab_org stored as parquet as
|
create table indi_project_collab_org stored as parquet as
|
||||||
-- select o1.id org1,o2.id org2, count(distinct o1.project) as collaborations
|
select o1.id org1,o2.id org2, count(distinct o1.project) as collaborations
|
||||||
-- from organization_projects as o1
|
from organization_projects as o1
|
||||||
-- join organization_projects as o2 on o1.project=o2.project
|
join organization_projects as o2 on o1.project=o2.project
|
||||||
-- where o1.id!=o2.id
|
where o1.id!=o2.id
|
||||||
-- group by o1.id, o2.id;
|
group by o1.id, o2.id;
|
||||||
--
|
|
||||||
-- compute stats indi_project_collab_org;
|
compute stats indi_project_collab_org;
|
||||||
--
|
|
||||||
-- create table indi_project_collab_org_country stored as parquet as
|
create table indi_project_collab_org_country stored as parquet as
|
||||||
-- with tmp as
|
with tmp as
|
||||||
-- (select o.id organization, o.country , ro.project as project from organization o
|
(select o.id organization, o.country , ro.project as project from organization o
|
||||||
-- join organization_projects ro on o.id=ro.id
|
join organization_projects ro on o.id=ro.id
|
||||||
-- and o.country <> 'UNKNOWN')
|
and o.country <> 'UNKNOWN')
|
||||||
-- select o1.organization org1,o2.country country2, count(distinct o1.project) as collaborations
|
select o1.organization org1,o2.country country2, count(distinct o1.project) as collaborations
|
||||||
-- from tmp as o1
|
from tmp as o1
|
||||||
-- join tmp as o2 on o1.project=o2.project
|
join tmp as o2 on o1.project=o2.project
|
||||||
-- where o1.organization<>o2.organization and o1.country<>o2.country
|
where o1.organization<>o2.organization and o1.country<>o2.country
|
||||||
-- group by o1.organization, o2.country;
|
group by o1.organization, o2.country;
|
||||||
--
|
|
||||||
-- compute stats indi_project_collab_org_country;
|
compute stats indi_project_collab_org_country;
|
||||||
--
|
|
||||||
-- create table indi_funder_country_collab stored as parquet as
|
create table indi_funder_country_collab stored as parquet as
|
||||||
-- with tmp as (select funder, project, country from organization_projects op
|
with tmp as (select funder, project, country from organization_projects op
|
||||||
-- join organization o on o.id=op.id
|
join organization o on o.id=op.id
|
||||||
-- join project p on p.id=op.project
|
join project p on p.id=op.project
|
||||||
-- where country <> 'UNKNOWN')
|
where country <> 'UNKNOWN')
|
||||||
-- select f1.funder, f1.country as country1, f2.country as country2, count(distinct f1.project) as collaborations
|
select f1.funder, f1.country as country1, f2.country as country2, count(distinct f1.project) as collaborations
|
||||||
-- from tmp as f1
|
from tmp as f1
|
||||||
-- join tmp as f2 on f1.project=f2.project
|
join tmp as f2 on f1.project=f2.project
|
||||||
-- where f1.country<>f2.country
|
where f1.country<>f2.country
|
||||||
-- group by f1.funder, f2.country, f1.country;
|
group by f1.funder, f2.country, f1.country;
|
||||||
--
|
|
||||||
-- compute stats indi_funder_country_collab;
|
compute stats indi_funder_country_collab;
|
||||||
--
|
--
|
||||||
-- create table indi_result_country_collab stored as parquet as
|
-- create table indi_result_country_collab stored as parquet as
|
||||||
-- with tmp as
|
-- with tmp as
|
||||||
|
|
|
@ -170,7 +170,9 @@ compute stats TARGET.indi_result_has_cc_licence;
|
||||||
create table TARGET.indi_result_has_cc_licence_url stored as parquet as select * from SOURCE.indi_result_has_cc_licence_url orig where exists (select 1 from TARGET.result r where r.id=orig.id);
|
create table TARGET.indi_result_has_cc_licence_url stored as parquet as select * from SOURCE.indi_result_has_cc_licence_url orig where exists (select 1 from TARGET.result r where r.id=orig.id);
|
||||||
compute stats TARGET.indi_result_has_cc_licence_url;
|
compute stats TARGET.indi_result_has_cc_licence_url;
|
||||||
|
|
||||||
-- create view TARGET.indi_funder_country_collab as select * from SOURCE.indi_funder_country_collab;
|
create view TARGET.indi_funder_country_collab as select * from SOURCE.indi_funder_country_collab;
|
||||||
|
create view TARGET.indi_project_collab_org as select * from SOURCE.indi_project_collab_org;
|
||||||
|
create view TARGET.indi_project_collab_org_country as select * from SOURCE.indi_project_collab_org_country;
|
||||||
|
|
||||||
create table TARGET.indi_result_with_orcid stored as parquet as select * from SOURCE.indi_result_with_orcid orig where exists (select 1 from TARGET.result r where r.id=orig.id);
|
create table TARGET.indi_result_with_orcid stored as parquet as select * from SOURCE.indi_result_with_orcid orig where exists (select 1 from TARGET.result r where r.id=orig.id);
|
||||||
compute stats TARGET.indi_result_with_orcid;
|
compute stats TARGET.indi_result_with_orcid;
|
||||||
|
|
Loading…
Reference in New Issue