Update createIndicatorsTablesSprint2.sql

This commit is contained in:
dimitrispie 2021-07-24 09:40:46 +03:00
parent 3d42652c44
commit 2036f8247c
1 changed files with 3 additions and 11 deletions

View File

@ -171,8 +171,8 @@ group by d.type, year)
select year, type, round(no_of_pubs/total*100,3) averageOfPubs
from total
create table TARGET.indi_pub_has_cc_licence_tr stored as parquet as
select distinct p.id, (case when lic='' or lic is null then 0 else 1 end) as has_cc_license_tr
create table TARGET.indi_pub_has_cc_licence stored as parquet as
select distinct p.id, (case when lic='' or lic is null then 0 else 1 end) as has_cc_license
from SOURCE.publication p
left outer join (select p.id, license.type as lic from SOURCE.publication p
join SOURCE.publication_licenses as license on license.id = p.id
@ -188,13 +188,6 @@ join SOURCE.publication_licenses as license on license.id = p.id
WHERE lower(parse_url(license.type, 'HOST')) = 'creativecommons.org') tmp
on p.id= tmp.id
create table TARGET.indi_pub_has_cc_licence_f stored as parquet as
select distinct p.id, (case when lic='' or lic is null then 0 else 1 end) as has_cc_license_f
from SOURCE.publication p
left outer join (select p.id, license.type as lic from SOURCE.publication p
join SOURCE.publication_licenses as license on license.id = p.id
where lower(license.type) LIKE '%creativecommons.org%' OR lower(license.type) LIKE '%cc-%') tmp
on p.id= tmp.id
create table TARGET.indi_pub_has_abstract stored as parquet as
select distinct publication.id, coalesce(abstract, 1) has_abstract
@ -216,7 +209,6 @@ compute stats TARGET.indi_other_avg_year_content_oa;
compute stats TARGET.indi_software_avg_year_content_oa;
compute stats TARGET.indi_dataset_avg_year_content_oa;
compute stats TARGET.indi_pub_avg_year_content_oa;
compute stats TARGET.indi_pub_has_cc_licence_tr;
compute stats TARGET.indi_pub_has_cc_licence;
compute stats TARGET.indi_pub_has_cc_licence_url;
compute stats TARGET.indi_pub_has_cc_licence_f;
compute stats TARGET.indi_pub_has_abstract;