sunchao commented on code in PR #5053:
URL: https://github.com/apache/datafusion-comet/pull/5053#discussion_r4054032380
##########
native/core/src/parquet/parquet_support.rs:
##########
@@ -1153,6 +1232,34 @@ mod tests {
object_store_cache().write().unwrap().remove(&key);
}
+ #[test]
+ fn isolates_azure_containers_in_cache_and_shared_runtime() {
+ use datafusion::execution::runtime_env::RuntimeEnvBuilder;
+
+ let options = HashMap::from([("fs.azure.account.key".into(),
"c2VjcmV0".into())]);
+ let runtime = RuntimeEnvBuilder::new()
+
.with_object_store_registry(Arc::new(super::CometObjectStoreRegistry::default()))
+ .build_arc()
+ .unwrap();
+ let register = |container| {
+ let (url, _, _) = prepare_object_store_with_configs(
+ Arc::clone(&runtime),
+
format!("abfss://{container}@account.dfs.core.windows.net/file.parquet"),
+ &options,
+ )
+ .unwrap();
+ (url.clone(), runtime.object_store(&url).unwrap())
+ };
+
+ let (url_a, store_a) = register("container-a");
+ let (same_url_a, same_store_a) = register("container-a");
+ let (url_b, store_b) = register("container-b");
+ assert_eq!(url_a, same_url_a);
+ assert!(Arc::ptr_eq(&store_a, &same_store_a));
+ assert_ne!(url_a, url_b);
+ assert!(!Arc::ptr_eq(&store_a, &store_b));
Review Comment:
Verified fixed in `9a50d58114f646a85dc3b70e54f5580d1409dfac`. The new late
lookups preserve both expected stores. I also temporarily substituted
`DefaultObjectStoreRegistry`: the test now fails at the new container-A
assertion, then passes again after restoring `CometObjectStoreRegistry`. This
covers the shared-runtime overwrite raised here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]