liurenjie1024 commented on code in PR #1580: URL: https://github.com/apache/iceberg-rust/pull/1580#discussion_r2259848719
########## crates/catalog/loader/src/lib.rs: ########## @@ -0,0 +1,77 @@ +// 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 std::sync::Arc; + +use async_trait::async_trait; +use iceberg::{Catalog, CatalogBuilder, Error, ErrorKind, Result}; +use iceberg_catalog_rest::RestCatalogBuilder; + +#[async_trait] +pub trait BoxedCatalogBuilder { Review Comment: > For the Box<Self>, I think we are only consuming the CatalogBuilder and doesn't need to share it, so I think Box<Self> is fine. +1. I think it's fine to put the `BoxedCatalogBuilder` here since it's mainly used by `load` function. ########## crates/catalog/rest/src/catalog.rs: ########## @@ -45,13 +46,18 @@ use crate::types::{ RegisterTableRequest, RenameTableRequest, }; +const REST_CATALOG_PROP_URI: &str = "uri"; +const REST_CATALOG_PROP_WAREHOUSE: &str = "warehouse"; const ICEBERG_REST_SPEC_VERSION: &str = "0.14.1"; const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); const PATH_V1: &str = "v1"; /// Rest catalog configuration. #[derive(Clone, Debug, TypedBuilder)] pub struct RestCatalogConfig { Review Comment: We should mark this as crate private, and adding doc to explain how to load a `RestCatalog` with the new approach, e.g. using the `RestCatalogBuilder`. Otherwise user will be confusing since we will have two methods for building rest catalog. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
