Skip to content

Commit

Permalink
test: add test to verify that s3 console url works
Browse files Browse the repository at this point in the history
  • Loading branch information
timvw committed Mar 27, 2024
1 parent ab4cd03 commit 329f339
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ async fn main() -> Result<()> {
.register_object_store(&s3_url, Arc::new(OpendalStore::new(op)));
}

let table_path = ListingTableUrl::parse(&args.path)?;
let table_path = ListingTableUrl::parse(data_path)?;
let mut config = ListingTableConfig::new(table_path);
config = config.infer_options(&ctx.state()).await?;
config = config.infer_schema(&ctx.state()).await?;
Expand Down
30 changes: 30 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,36 @@ async fn run_with_s3_parquet_file() -> datafusion::common::Result<()> {
.stdout(data_predicate);
Ok(())
}

#[tokio::test]
async fn run_with_s3_console_parquet_file() -> datafusion::common::Result<()> {
configure_minio();

let mut cmd = get_qv_cmd()?;
let cmd = cmd
.arg("https://s3.console.aws.amazon.com/s3/buckets/data?region=eu-central-1&prefix=iceberg/db/COVID-19_NYT/data/00000-2-2d39563f-6901-4e2d-9903-84a8eab8ac3d-00001.parquet&showversions=false")
.arg("-q")
.arg("select * from tbl order by date, county, state, fips, cases, deaths");

let header_predicate =
build_row_regex_predicate(vec!["date", "county", "state", "fips", "case", "deaths"]);

let data_predicate = build_row_regex_predicate(vec![
"2020-01-21",
"Snohomish",
"Washington",
"53061",
"1",
"0",
]);

cmd.assert()
.success()
.stdout(header_predicate)
.stdout(data_predicate);
Ok(())
}

/*
#[tokio::test]
async fn run_with_s3_parquet_files_in_folder() -> datafusion::common::Result<()> {
Expand Down

0 comments on commit 329f339

Please sign in to comment.