Comment out step 15 to make it work with the new schema of Claudio

This commit is contained in:
Spyros Zoupanos 2020-06-25 19:45:57 +03:00
parent 138c6ddffa
commit 63cd797aba
1 changed files with 32 additions and 26 deletions

View File

@ -5,31 +5,37 @@
-- Refereed related tables/views -- Refereed related tables/views
------------------------------------------------------ ------------------------------------------------------
------------------------------------------------------ ------------------------------------------------------
CREATE TABLE IF NOT EXISTS ${stats_db_name}.publication_refereed as
select substr(r.id, 4) as id, inst.refereed.value as refereed
from ${openaire_db_name}.publication r lateral view explode(r.instance) instances as inst
where r.datainfo.deletedbyinference=false;
CREATE TABLE IF NOT EXISTS ${stats_db_name}.dataset_refereed as -- To be commented out after the following queries are adapted to
select substr(r.id, 4) as id, inst.refereed.value as refereed -- the new openAIRE graph schema.
from ${openaire_db_name}.dataset r lateral view explode(r.instance) instances as inst -- When it is ready they should be added to the to statistic recalculation
where r.datainfo.deletedbyinference=false; -- for the impala tables and the shadow views
CREATE TABLE IF NOT EXISTS ${stats_db_name}.software_refereed as -- CREATE TABLE IF NOT EXISTS ${stats_db_name}.publication_refereed as
select substr(r.id, 4) as id, inst.refereed.value as refereed -- select substr(r.id, 4) as id, inst.refereed.value as refereed
from ${openaire_db_name}.software r lateral view explode(r.instance) instances as inst -- from ${openaire_db_name}.publication r lateral view explode(r.instance) instances as inst
where r.datainfo.deletedbyinference=false; -- where r.datainfo.deletedbyinference=false;
--
CREATE TABLE IF NOT EXISTS ${stats_db_name}.otherresearchproduct_refereed as -- CREATE TABLE IF NOT EXISTS ${stats_db_name}.dataset_refereed as
select substr(r.id, 4) as id, inst.refereed.value as refereed -- select substr(r.id, 4) as id, inst.refereed.value as refereed
from ${openaire_db_name}.otherresearchproduct r lateral view explode(r.instance) instances as inst -- from ${openaire_db_name}.dataset r lateral view explode(r.instance) instances as inst
where r.datainfo.deletedbyinference=false; -- where r.datainfo.deletedbyinference=false;
--
CREATE VIEW IF NOT EXISTS ${stats_db_name}.result_refereed as -- CREATE TABLE IF NOT EXISTS ${stats_db_name}.software_refereed as
select * from ${stats_db_name}.publication_refereed -- select substr(r.id, 4) as id, inst.refereed.value as refereed
union all -- from ${openaire_db_name}.software r lateral view explode(r.instance) instances as inst
select * from ${stats_db_name}.dataset_refereed -- where r.datainfo.deletedbyinference=false;
union all --
select * from ${stats_db_name}.software_refereed -- CREATE TABLE IF NOT EXISTS ${stats_db_name}.otherresearchproduct_refereed as
union all -- select substr(r.id, 4) as id, inst.refereed.value as refereed
select * from ${stats_db_name}.otherresearchproduct_refereed; -- from ${openaire_db_name}.otherresearchproduct r lateral view explode(r.instance) instances as inst
-- where r.datainfo.deletedbyinference=false;
--
-- CREATE VIEW IF NOT EXISTS ${stats_db_name}.result_refereed as
-- select * from ${stats_db_name}.publication_refereed
-- union all
-- select * from ${stats_db_name}.dataset_refereed
-- union all
-- select * from ${stats_db_name}.software_refereed
-- union all
-- select * from ${stats_db_name}.otherresearchproduct_refereed;