liurenjie1024 commented on code in PR #1580:
URL: https://github.com/apache/iceberg-rust/pull/1580#discussion_r2262460611


##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -45,13 +46,113 @@ 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";
 
+/// Builder for [`RestCatalog`].
+/// To build a rest catalog with configurations
+///
+/// # Example
+///
+/// ```rust, no_run
+/// use std::collections::HashMap;
+///
+/// use iceberg::CatalogBuilder;
+/// use iceberg_catalog_rest::RestCatalogBuilder;
+///
+/// #[tokio::main]
+/// async fn main() {
+///     let catalog = RestCatalogBuilder::default()
+///         .load(
+///             "rest",
+///             HashMap::from([
+///                 ("uri".to_string(), "http://localhost:8181".to_string()),
+///                 ("warehouse".to_string(), "s3://warehouse".to_string()),
+///             ]),
+///         )
+///         .await
+///         .unwrap();
+/// }
+/// ```

Review Comment:
   How about moving this crate's doc, e.g. in lib.rs? This should be the first 
thing a user sees when using this crate.



##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -45,13 +46,113 @@ use crate::types::{
     RegisterTableRequest, RenameTableRequest,
 };
 
+const REST_CATALOG_PROP_URI: &str = "uri";

Review Comment:
   We should make them public as users are epxecting to use these constants 
rather than raw string.



##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -45,13 +46,113 @@ 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";
 
+/// Builder for [`RestCatalog`].
+/// To build a rest catalog with configurations
+///
+/// # Example
+///
+/// ```rust, no_run
+/// use std::collections::HashMap;
+///
+/// use iceberg::CatalogBuilder;
+/// use iceberg_catalog_rest::RestCatalogBuilder;
+///
+/// #[tokio::main]
+/// async fn main() {
+///     let catalog = RestCatalogBuilder::default()
+///         .load(
+///             "rest",
+///             HashMap::from([
+///                 ("uri".to_string(), "http://localhost:8181".to_string()),

Review Comment:
   We should use constants rather than raw string as better practice. Please 
change all appearances.



-- 
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]

Reply via email to