DerGut commented on code in PR #1368:
URL: https://github.com/apache/iceberg-rust/pull/1368#discussion_r2102303084


##########
crates/iceberg/src/io/storage_azdls.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 std::collections::HashMap;
+
+use opendal::Configurator;
+use opendal::services::AzdlsConfig;
+use url::Url;
+
+use crate::{Error, ErrorKind, Result};
+
+/// A connection string.
+///
+/// This could be used to use FileIO with any adls-compatible object storage
+/// service that has a different endpoint (like Azurite).
+///
+/// Note, this string is parsed first, and any other passed adls.* properties
+/// will override values from the connection string.
+const ADLS_CONNECTION_STRING: &str = "adls.connection-string";
+
+/// The account that you want to connect to.
+pub const ADLS_ACCOUNT_NAME: &str = "adls.account-name";
+
+/// The key to authentication against the account.
+pub const ADLS_ACCOUNT_KEY: &str = "adls.account-key";
+
+/// The shared access signature.
+pub const ADLS_SAS_TOKEN: &str = "adls.sas-token";
+
+/// The tenant-id.
+pub const ADLS_TENANT_ID: &str = "adls.tenant-id";
+
+/// The client-id.
+pub const ADLS_CLIENT_ID: &str = "adls.client-id";
+
+/// The client-secret.
+pub const ADLS_CLIENT_SECRET: &str = "adls.client-secret";
+
+/// Parses adls.* prefixed configuration properties.
+pub(crate) fn azdls_config_parse(mut m: HashMap<String, String>) -> 
Result<AzdlsConfig> {
+    let mut cfg = AzdlsConfig::default();
+
+    if let Some(_conn_str) = m.remove(ADLS_CONNECTION_STRING) {
+        return Err(Error::new(

Review Comment:
   When we get connection string parsing [into 
OpenDAL](https://github.com/apache/opendal/pull/6212), we should be able to 
call something like `AzdlsConfig::try_from_connection_string()` here instead.
   
   Then, we can also mark the `ADLS_CONNECTION_STRING` constant as public.



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to