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

Function query_http_location_test

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

Source from the content-addressed store, hash-verified

246
247 #[tokio::test]
248 async fn query_http_location_test() -> Result<()> {
249 // This is a unit test so not expecting a connection or a file to be
250 // available
251 let domain = "example.com";
252 let location = format!("http://{domain}/file.parquet");
253
254 let (ctx, schema) = setup_context();
255
256 // That's a non registered table so expecting None here
257 let table = schema.table(&location).await?;
258 assert!(table.is_none());
259
260 // It should still create an object store for the location in the SessionState
261 let store = ctx
262 .runtime_env()
263 .object_store(ListingTableUrl::parse(location)?)?;
264
265 assert_eq!(format!("{store}"), "HttpStore");
266
267 // The store must be configured for this domain
268 let expected_domain = format!("Domain(\"{domain}\")");
269 assert!(format!("{store:?}").contains(&expected_domain));
270
271 Ok(())
272 }
273
274 #[tokio::test]
275 async fn query_s3_location_test() -> Result<()> {

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…