@@ -89,6 +89,39 @@ impl RuntimeEnv {
8989 /// scheme, if any.
9090 ///
9191 /// See [`ObjectStoreRegistry`] for more details
92+ ///
93+ /// # Example: Register local file system object store
94+ /// ```
95+ /// # use std::sync::Arc;
96+ /// # use url::Url;
97+ /// # use datafusion_execution::runtime_env::RuntimeEnv;
98+ /// # let runtime_env = RuntimeEnv::new(Default::default()).unwrap();
99+ /// let url = Url::try_from("file://").unwrap();
100+ /// let object_store = object_store::local::LocalFileSystem::new();
101+ /// // register the object store with the runtime environment
102+ /// runtime_env.register_object_store(&url, Arc::new(object_store));
103+ /// ```
104+ ///
105+ /// # Example: Register local file system object store
106+ ///
107+ /// To register reading from urls such as <https://github.com>`
108+ ///
109+ /// ```
110+ /// # use std::sync::Arc;
111+ /// # use url::Url;
112+ /// # use datafusion_execution::runtime_env::RuntimeEnv;
113+ /// # let runtime_env = RuntimeEnv::new(Default::default()).unwrap();
114+ /// # // use local store for example as http feature is not enabled
115+ /// # let http_store = object_store::local::LocalFileSystem::new();
116+ /// // create a new object store via object_store::http::HttpBuilder;
117+ /// let base_url = Url::parse("https://github.com").unwrap();
118+ /// // let http_store = HttpBuilder::new()
119+ /// // .with_url(base_url.clone())
120+ /// // .build()
121+ /// // .unwrap();
122+ /// // register the object store with the runtime environment
123+ /// runtime_env.register_object_store(&base_url, Arc::new(http_store));
124+ /// ```
92125 pub fn register_object_store (
93126 & self ,
94127 url : & Url ,
0 commit comments