Skip to content

Commit

Permalink
fix: setup parquet wapper and server
Browse files Browse the repository at this point in the history
  • Loading branch information
kysshsy committed Oct 4, 2024
1 parent ad697b7 commit 95bf491
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions tests/fixtures/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,20 @@ pub fn setup_local_file_listing_with_casing(local_file_path: &str, table: &str)
)
}

pub fn setup_parquet_wrapper_and_server() -> String {
let create_foreign_data_wrapper = primitive_create_foreign_data_wrapper(
"parquet_wrapper",
"parquet_fdw_handler",
"parquet_fdw_validator",
);
let create_server = primitive_create_server("parquet_server", "parquet_wrapper");
format!(
"{create_foreign_data_wrapper};
{create_server};
"
)
}

fn valid(data_type: &DataType, oid: u32) -> bool {
let oid = match PgBuiltInOids::from_u32(oid) {
Ok(oid) => oid,
Expand Down
4 changes: 3 additions & 1 deletion tests/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::fixtures::arrow::{
primitive_create_table, primitive_create_user_mapping_options, primitive_record_batch,
primitive_record_batch_single, primitive_setup_fdw_local_file_delta,
primitive_setup_fdw_local_file_listing, primitive_setup_fdw_s3_delta,
primitive_setup_fdw_s3_listing,
primitive_setup_fdw_s3_listing, setup_parquet_wrapper_and_server,
};
use crate::fixtures::db::Query;
use crate::fixtures::{conn, duckdb_conn, s3, tempdir, S3};
Expand Down Expand Up @@ -615,6 +615,8 @@ async fn test_prepare_search_path(mut conn: PgConnection, tempdir: TempDir) -> R
"CREATE SCHEMA tpch1".execute(&mut conn);
"CREATE SCHEMA tpch2".execute(&mut conn);

setup_parquet_wrapper_and_server().execute(&mut conn);

let file_path = parquet_path.as_path().to_str().unwrap();
let file_less_path = less_parquet_path.as_path().to_str().unwrap();

Expand Down

0 comments on commit 95bf491

Please sign in to comment.