master #59

Closed
claudio.atzori wants to merge 3221 commits from master into stable_ids
1 changed files with 10 additions and 7 deletions
Showing only changes of commit 0bf2a7a359 - Show all commits

View File

@ -1000,13 +1000,16 @@ left outer join (
drop table if exists ${stats_db_name}.result_country purge; /*EOS*/ drop table if exists ${stats_db_name}.result_country purge; /*EOS*/
create table ${stats_db_name}.result_country stored as parquet as create table ${stats_db_name}.result_country stored as parquet as
select distinct ro.id, coalesce(o.country, f.country) as country select distinct * from (
from ${stats_db_name}.result_organization ro select ro.id, o.country as country
left outer join ${stats_db_name}.organization o on o.id=ro.organization from ${stats_db_name}.result_organization ro
left outer join ${stats_db_name}.result_projects rp on rp.id=ro.id join ${stats_db_name}.organization o on o.id=ro.organization
left outer join ${stats_db_name}.project p on p.id=rp.project union all
left outer join ${stats_db_name}.funder f on f.name=p.funder select rp.id, f.country as country
where coalesce(o.country, f.country) IS NOT NULL; /*EOS*/ from ${stats_db_name}.result_projects rp
left outer join ${stats_db_name}.project p on p.id=rp.project
left outer join ${stats_db_name}.funder f on f.name=p.funder ) u
where u.country is not NULL; /*EOS*/
drop table if exists ${stats_db_name}.indi_result_oa_with_license purge; /*EOS*/ drop table if exists ${stats_db_name}.indi_result_oa_with_license purge; /*EOS*/
create table ${stats_db_name}.indi_result_oa_with_license stored as parquet as create table ${stats_db_name}.indi_result_oa_with_license stored as parquet as