Skip to content

Commit

Permalink
Merge branch 'master' into 'master'
Browse files Browse the repository at this point in the history
add parquet_uba_event&parquet_uba_profile to get uba test data dir in test_utils

Closes #10

See merge request noah/argo_engine!13
  • Loading branch information
江振兴 committed Nov 23, 2021
2 parents 5c7ef08 + 8f10c32 commit 4063db7
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion utils/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ pub fn parquet_lineorder_flat() -> String {
}
}

pub fn parquet_uba_event() -> String {
match get_data_dir("UBA_EVENT_TEST_DATA", "../data/90d_100dau/event") {
Ok(pb) => pb.display().to_string(),
Err(err) => panic!("failed to get parquet data dir: {}", err),
}
}

pub fn parquet_uba_profile() -> String {
match get_data_dir("UBA_PROFILE_TEST_DATA", "../data/90d_100dau/profile") {
Ok(pb) => pb.display().to_string(),
Err(err) => panic!("failed to get parquet data dir: {}", err),
}
}


fn get_data_dir(udf_env: &str, submodule_data: &str) -> Result<PathBuf, Box<dyn Error>> {
// Try user defined env.
if let Ok(dir) = env::var(udf_env) {
Expand Down Expand Up @@ -46,7 +61,19 @@ mod tests {
use super::*;

#[test]
fn get_parquet_lineorder_flat_1() {
fn get_parquet_lineorder_flat() {
println!("{}", parquet_lineorder_flat())
}

#[test]
fn get_parquet_uba_event() {
println!("{}", parquet_uba_event())
}


#[test]
fn get_parquet_uba_profile() {
println!("{}", parquet_uba_profile())
}

}

0 comments on commit 4063db7

Please sign in to comment.