Added Pig scripts for testing

This commit is contained in:
Michał Ciesiółka 2023-12-30 21:26:06 +01:00
parent 87da2b7520
commit 3faabb822c
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,8 @@
-- load a single system table from a dataset
sys = load 'datasets="mocca 14bd768a5357ab95df307e58a70657ba" tables="system"' using BeansTable();
-- generate some example columns
sys = foreach sys generate rchut2, smt;
-- basic filtering
sys = filter sys by smt > 0.0;
-- store into a table
store sys into 'name="test_load_filter_store"' using BeansTable();

View File

@ -0,0 +1,8 @@
-- load system table from a single dataset
sys = load 'datasets="mocca 01f4f7bfadd9ee5ab2568d73ee7b9dda" tables="system"' using BeansTable();
-- generate only the needed columns for this test
sys = foreach sys generate DSID(tbid) as dsid,
DSPARAMSTRING(DSID(tbid), 'moccaid') as moccaid,
tphys;
-- store the data
store sys into 'name="test_data_for_join_01f4f7bfadd9ee5ab2568d73ee7b9dda"' using BeansTable();

View File

@ -0,0 +1,17 @@
-- load the previously generated data
sys = load 'datasets="Testing Notebook" tables="test_data_for_join_01f4f7bfadd9ee5ab2568d73ee7b9dda"' using BeansTable();
-- load the collapse information table
collapse = load 'datasets="core collapse and blue stragglers" tables="collapseMyr_vs_bssdynBssEvol"' using BeansTable();
-- join sys and collapse by sys::moccaid == collapse::dsid
j = join sys by moccaid, collapse by dsid;
-- generate the columns and add a collapse column (1 - collapsed, 0 - not collapsed)
j = foreach j generate sys::tbid as tbid,
sys::dsid as dsid,
sys::moccaid as moccaid,
sys::tphys as tphys,
collapse::collapseMyr as collapseMyr,
collapse::confidence as confidence,
(sys::tphys < collapse::collapseMyr ? 0 : 1) as collapsed:int
;
-- store the joined table
store j into 'name="test_01f4f7bfadd9ee5ab2568d73ee7b9dda_with_collapse"' using BeansTable();

View File

@ -0,0 +1,4 @@
-- load a table that was previously saved
sys = load 'datasets="Testing Notebook" tables="test_load_filter_store"' using BeansTable();
-- store the loaded table to check if it lads correctly
store sys into 'name="TEST_LOAD_BY_NAME_FROM_NOTEBOOK"' using BeansTable();