MCPcopy Create free account
hub / github.com/apache/datafusion / query_s3_location_test

Function query_s3_location_test

datafusion-cli/src/catalog.rs:275–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

273
274 #[tokio::test]
275 async fn query_s3_location_test() -> Result<()> {
276 let aws_envs = vec![
277 "AWS_ENDPOINT",
278 "AWS_ACCESS_KEY_ID",
279 "AWS_SECRET_ACCESS_KEY",
280 "AWS_ALLOW_HTTP",
281 ];
282 for aws_env in aws_envs {
283 if env::var(aws_env).is_err() {
284 eprint!("aws envs not set, skipping s3 test");
285 return Ok(());
286 }
287 }
288
289 let bucket = "examples3bucket";
290 let location = format!("s3://{bucket}/file.parquet");
291
292 let (ctx, schema) = setup_context();
293
294 let table = schema.table(&location).await?;
295 assert!(table.is_none());
296
297 let store = ctx
298 .runtime_env()
299 .object_store(ListingTableUrl::parse(location)?)?;
300 assert_eq!(format!("{store}"), format!("AmazonS3({bucket})"));
301
302 // The store must be configured for this domain
303 let expected_bucket = format!("bucket: \"{bucket}\"");
304 assert!(format!("{store:?}").contains(&expected_bucket));
305
306 Ok(())
307 }
308
309 #[tokio::test]
310 async fn query_gs_location_test() -> Result<()> {

Callers

nothing calls this directly

Calls 5

is_errMethod · 0.80
setup_contextFunction · 0.70
tableMethod · 0.45
object_storeMethod · 0.45
runtime_envMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…