Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor transform scripts to drop temporary tables in a centralized way #533

Open
burrowse opened this issue Sep 9, 2021 · 0 comments
Open

Comments

@burrowse
Copy link
Contributor

burrowse commented Sep 9, 2021

Within the current transform, temporary tables are created and dropped in various parts in the script making it difficult to test changes that may create temporary tables or assert data temporarily before loading in the "final" tables.

Examples (including but not limited to) are as follows:

h_immunization.sql

begin;
drop table SITE_pcornet.imm_code;
commit;

https://github.com/PEDSnet/pedsnetcdm_to_pcornetcdm/blob/e79db62fbb902476abbf43295de3a5256923948c/v4.3_to_v6.0/sql_etl/scripts/etl_scripts/h_immunization.sql#L69-71

n_obs_clin.sql

drop table if exists SITE_pcornet.meas_obsclin;
drop table if exists SITE_pcornet.obs_vaping;
drop table if exists SITE_pcornet.tobacco_obclin;
drop table if exists SITE_pcornet.gestational_age;

Potential solution is to move these to the current drop table script : r_drop_tbl so all clean-up steps can be performed in one place.

@burrowse burrowse changed the title Refactor transform scripts to drop temporary tables in a more organized fashion Refactor transform scripts to drop temporary tables in a centralized way Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant