You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/05/09 16:38:35 UTC

[GitHub] [arrow-rs] alamb commented on a diff in pull request #4184: Add ObjectStoreScheme (#4047)

alamb commented on code in PR #4184:
URL: https://github.com/apache/arrow-rs/pull/4184#discussion_r1188866058


##########
object_store/src/scheme.rs:
##########
@@ -0,0 +1,130 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use crate::{Error, Result};
+use url::Url;
+
+/// Recognises various URL formats, identifying the relevant [`ObjectStore`](crate::ObjectStore)
+///
+/// This can be combined with the [with_url](crate::aws::AmazonS3Builder::with_url) methods
+/// on the corresponding builder to construct the relevant type of store
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
+pub enum ObjectStoreScheme {

Review Comment:
   I don't fully understand why you are proposing to add this to the object store crate.
   
   Users of `object_store` would still have to match on the resulting scheme and instantiate a builder / configuration appropriate to whatever they wanted. The extra value to having a hard coded list of url prefixes seems relatively minimal.
   
   Maybe this is just a first step. 
   
   If I were a user I would want something that took a url like `s3://foo-bucket` or `https://andrew:lamb@foo.com/path` and returned an `Arc<dyn ObjectStore>` . 
   
   For convenience the object_store crate could have default interpretations of these urls, but also some way to extend the API;
   
   Basically I think the API here makes a lot of sense https://docs.rs/datafusion/latest/datafusion/datasource/object_store/trait.ObjectStoreRegistry.html 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org