r3stl355 commented on code in PR #9150:
URL: https://github.com/apache/arrow-datafusion/pull/9150#discussion_r1482105042
##########
datafusion-cli/src/catalog.rs:
##########
@@ -151,10 +154,35 @@ impl SchemaProvider for DynamicFileSchemaProvider {
// if the inner schema provider didn't have a table by
// that name, try to treat it as a listing table
let state = self.state.upgrade()?.read().clone();
- let config =
ListingTableConfig::new(ListingTableUrl::parse(name).ok()?)
+ let table_url = ListingTableUrl::parse(name).ok()?;
+
+ // Assure the `http` store for this url is registered if this
+ // is an `http(s)` listing
+ // TODO: support for other types, e.g. `s3`, may need to be added
+ match table_url.scheme() {
+ "http" | "https" => {
+ let url: &Url = table_url.as_ref();
+ match state.runtime_env().object_store_registry.get_store(url)
{
+ Ok(_) => {}
+ Err(_) => {
Review Comment:
I saw it as an easy way to avoid re-registering the store for the same url.
If you query the same url multiple times, it will err on first call so the
store will be registered, on subsequent queries it will not. Happy to change if
you can suggest something different
--
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]