Changes to indicator and monitor scripts

This commit is contained in:
dimitrispie 2022-09-09 13:15:58 +03:00
parent 2b5f8c9c9a
commit 71b069ca90
2 changed files with 12 additions and 9 deletions

View File

@ -564,12 +564,12 @@ create table indi_org_fairness stored as parquet as
(select ro.organization organization, count(distinct ro.id) no_result_fair from result_organization ro (select ro.organization organization, count(distinct ro.id) no_result_fair from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
--join result_pids rp on r.id=rp.id --join result_pids rp on r.id=rp.id
where (title is not null) and (publisher is not null) and (abstract is true) and (year is not null) and (authors>0) and year>2003 where (title is not null) and (publisher is not null) and (abstract is true) and (year is not null) and (authors>0) and cast(year as int)>2003
group by ro.organization), group by ro.organization),
--return all results group by organization --return all results group by organization
allresults as (select organization, count(distinct ro.id) no_allresults from result_organization ro allresults as (select organization, count(distinct ro.id) no_allresults from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
where year>2003 where cast(year as int)>2003
group by organization) group by organization)
--return results_fair/all_results --return results_fair/all_results
select allresults.organization, result_fair.no_result_fair/allresults.no_allresults org_fairness select allresults.organization, result_fair.no_result_fair/allresults.no_allresults org_fairness
@ -638,11 +638,11 @@ create table indi_org_fairness_year stored as parquet as
(select year, ro.organization organization, count(distinct ro.id) no_result_fair from result_organization ro (select year, ro.organization organization, count(distinct ro.id) no_result_fair from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
join result_pids rp on r.id=rp.id join result_pids rp on r.id=rp.id
where (title is not null) and (publisher is not null) and (abstract is true) and (year is not null) and (authors>0) and year>2003 where (title is not null) and (publisher is not null) and (abstract is true) and (year is not null) and (authors>0) and cast(year as int)>2003
group by ro.organization, year), group by ro.organization, year),
allresults as (select year, organization, count(distinct ro.id) no_allresults from result_organization ro allresults as (select year, organization, count(distinct ro.id) no_allresults from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
where year>2003 where cast(year as int)>2003
group by organization, year) group by organization, year)
--return results_fair/all_results --return results_fair/all_results
select allresults.year, allresults.organization, result_fair.no_result_fair/allresults.no_allresults org_fairness select allresults.year, allresults.organization, result_fair.no_result_fair/allresults.no_allresults org_fairness
@ -657,12 +657,12 @@ create table indi_org_findable_year stored as parquet as
(select year, ro.organization organization, count(distinct rp.id) no_result_with_pid from result_organization ro (select year, ro.organization organization, count(distinct rp.id) no_result_with_pid from result_organization ro
join result_pids rp on rp.id=ro.id join result_pids rp on rp.id=ro.id
join result r on r.id=rp.id join result r on r.id=rp.id
where year >2003 where cast(year as int) >2003
group by ro.organization, year), group by ro.organization, year),
--return all results group by organization,year --return all results group by organization,year
allresults as (select year, organization, count(distinct ro.id) no_allresults from result_organization ro allresults as (select year, organization, count(distinct ro.id) no_allresults from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
where year >2003 where cast(year as int) >2003
group by organization, year) group by organization, year)
--return results_with_pid/all_results --return results_with_pid/all_results
select allresults.year, allresults.organization, result_with_pid.no_result_with_pid/allresults.no_allresults org_findable select allresults.year, allresults.organization, result_with_pid.no_result_with_pid/allresults.no_allresults org_findable
@ -677,12 +677,12 @@ create table indi_org_findable stored as parquet as
(select ro.organization organization, count(distinct rp.id) no_result_with_pid from result_organization ro (select ro.organization organization, count(distinct rp.id) no_result_with_pid from result_organization ro
join result_pids rp on rp.id=ro.id join result_pids rp on rp.id=ro.id
join result r on r.id=rp.id join result r on r.id=rp.id
where year >2003 where cast(year as int) >2003
group by ro.organization), group by ro.organization),
--return all results group by organization --return all results group by organization
allresults as (select organization, count(distinct ro.id) no_allresults from result_organization ro allresults as (select organization, count(distinct ro.id) no_allresults from result_organization ro
join result r on r.id=ro.id join result r on r.id=ro.id
where year >2003 where cast(year as int) >2003
group by organization) group by organization)
--return results_with_pid/all_results --return results_with_pid/all_results
select allresults.organization, result_with_pid.no_result_with_pid/allresults.no_allresults org_findable select allresults.organization, result_with_pid.no_result_with_pid/allresults.no_allresults org_findable

View File

@ -45,7 +45,10 @@ create table TARGET.result stored as parquet as
'openorgs____::15e7921fc50d9aa1229a82a84429419e', -- University Of Thessaly 'openorgs____::15e7921fc50d9aa1229a82a84429419e', -- University Of Thessaly
'openorgs____::11f7919dadc8f8a7251af54bba60c956', -- Technical University of Crete 'openorgs____::11f7919dadc8f8a7251af54bba60c956', -- Technical University of Crete
'openorgs____::84f0c5f5dbb6daf42748485924efde4b', -- University of Piraeus 'openorgs____::84f0c5f5dbb6daf42748485924efde4b', -- University of Piraeus
'openorgs____::4ac562f0376fce3539504567649cb373' -- University of Patras 'openorgs____::4ac562f0376fce3539504567649cb373', -- University of Patras
'openorgs____::3e8d1f8c3f6cd7f418b09f1f58b4873b', -- Aristotle University of Thessaloniki
'openorgs____::3fcef6e1c469c10f2a84b281372c9814', -- World Bank
'openorgs____::1698a2eb1885ef8adb5a4a969e745ad3' -- École des Ponts ParisTech
) )) foo; ) )) foo;
compute stats TARGET.result; compute stats TARGET.result;