marvinlanhenke commented on code in PR #285:
URL: https://github.com/apache/iceberg-rust/pull/285#discussion_r1531800011


##########
crates/catalog/hms/src/utils.rs:
##########
@@ -183,6 +227,65 @@ pub(crate) fn validate_namespace(namespace: 
&NamespaceIdent) -> Result<String> {
     Ok(name)
 }
 
+/// Get default table location from `Namespace` properties
+pub(crate) fn get_default_table_location(
+    namespace: &Namespace,
+    table_name: impl AsRef<str> + Display,

Review Comment:
   fixed



##########
crates/catalog/hms/src/utils.rs:
##########
@@ -183,6 +227,65 @@ pub(crate) fn validate_namespace(namespace: 
&NamespaceIdent) -> Result<String> {
     Ok(name)
 }
 
+/// Get default table location from `Namespace` properties
+pub(crate) fn get_default_table_location(
+    namespace: &Namespace,
+    table_name: impl AsRef<str> + Display,
+) -> Result<String> {
+    let properties = namespace.properties();
+    properties
+        .get(LOCATION)
+        .or_else(|| properties.get(WAREHOUSE_LOCATION))
+        .map(|location| format!("{}/{}", location, table_name))
+        .ok_or_else(|| {
+            Error::new(
+                ErrorKind::DataInvalid,
+                "No default path is set, please specify a location when 
creating a table",
+            )
+        })
+}
+
+/// Create metadata location from `location` and `version`
+pub(crate) fn create_metadata_location(
+    location: impl AsRef<str> + Display,

Review Comment:
   fixed



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