You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add hive metastore catalog support (part 1/2) (#237)
* fmt members
* setup basic test-infra for hms-catalog
* add license
* add hms create_namespace
* add hms get_namespace
* fix: typo
* add hms namespace_exists and drop_namespace
* add hms update_namespace
* move fns into HmsCatalog
* use `expose` in docker-compose
* add hms list_tables
* fix: clippy
* fix: cargo sort
* fix: cargo workspace
* move fns into utils + add constants
* include database name in error msg
* add pilota to cargo workspace
* add minio version
* change visibility to pub(crate); return namespace from conversion fn
* add minio version in rest-catalog docker-compose
* fix: hms test docker infrastructure
* add version to minio/mc
* fix: license header
* fix: core-site
---------
Co-authored-by: mlanhenke <[email protected]>
/// Refer to <https://github.com/apache/iceberg/blob/main/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java> for implementation details.
101
102
#[async_trait]
102
103
implCatalogforHmsCatalog{
103
104
/// HMS doesn't support nested namespaces.
@@ -125,36 +126,165 @@ impl Catalog for HmsCatalog {
125
126
.collect())
126
127
}
127
128
129
+
/// Creates a new namespace with the given identifier and properties.
130
+
///
131
+
/// Attempts to create a namespace defined by the `namespace`
132
+
/// parameter and configured with the specified `properties`.
133
+
///
134
+
/// This function can return an error in the following situations:
135
+
///
136
+
/// - If `hive.metastore.database.owner-type` is specified without
137
+
/// `hive.metastore.database.owner`,
138
+
/// - Errors from `validate_namespace` if the namespace identifier does not
139
+
/// meet validation criteria.
140
+
/// - Errors from `convert_to_database` if the properties cannot be
141
+
/// successfully converted into a database configuration.
142
+
/// - Errors from the underlying database creation process, converted using
143
+
/// `from_thrift_error`.
128
144
asyncfncreate_namespace(
129
145
&self,
130
-
_namespace:&NamespaceIdent,
131
-
_properties:HashMap<String,String>,
146
+
namespace:&NamespaceIdent,
147
+
properties:HashMap<String,String>,
132
148
) -> Result<Namespace>{
133
-
todo!()
149
+
let database = convert_to_database(namespace,&properties)?;
0 commit comments