alamb commented on code in PR #4184: URL: https://github.com/apache/arrow-rs/pull/4184#discussion_r1188879415
########## 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: > This API is just a trait? It doesn't contain any parsing logic, nor any logic to interpret schemes directly The API is a trait but DataFusion provides default parsing logic / scheme interpretation in https://docs.rs/datafusion/latest/datafusion/datasource/object_store/struct.DefaultObjectStoreRegistry.html > As explained in the description, because there isn't a way I can see to make such an API that is both coherent and not extremely opinionated... I wast trying to suggest an API that let users implement their own opinions while also providing a default implementation that worked for simple cases (with whatever opinions you wanted) -- 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]
