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

Function query_gs_location_test

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

Source from the content-addressed store, hash-verified

308
309 #[tokio::test]
310 async fn query_gs_location_test() -> Result<()> {
311 let bucket = "examplegsbucket";
312 let location = format!("gs://{bucket}/file.parquet");
313
314 let (ctx, schema) = setup_context();
315
316 let table = schema.table(&location).await?;
317 assert!(table.is_none());
318
319 let store = ctx
320 .runtime_env()
321 .object_store(ListingTableUrl::parse(location)?)?;
322 assert_eq!(format!("{store}"), format!("GoogleCloudStorage({bucket})"));
323
324 // The store must be configured for this domain
325 let expected_bucket = format!("bucket_name_encoded: \"{bucket}\"");
326 assert!(format!("{store:?}").contains(&expected_bucket));
327
328 Ok(())
329 }
330
331 #[tokio::test]
332 async fn query_invalid_location_test() {

Callers

nothing calls this directly

Calls 4

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…