haizhou-zhao commented on code in PR #6045:
URL: https://github.com/apache/iceberg/pull/6045#discussion_r1018262364


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -358,6 +361,85 @@ public void testCreateNamespace() throws Exception {
         "There no same location for db and namespace", 
database2.getLocationUri(), hiveLocalDir);
   }
 
+  @Test
+  public void testCreateNamespaceWithOwnership() throws Exception {
+    createNamespaceAndVerifyOwnership(
+        "individual_ownership_1",
+        ImmutableMap.of(
+            HiveCatalog.HMS_DB_OWNER,
+            "apache",
+            HiveCatalog.HMS_DB_OWNER_TYPE,
+            PrincipalType.USER.name()),
+        "apache",
+        PrincipalType.USER);
+
+    createNamespaceAndVerifyOwnership(
+        "individual_ownership_2",
+        ImmutableMap.of(HiveCatalog.HMS_DB_OWNER, "someone"),
+        "someone",
+        PrincipalType.USER);
+
+    createNamespaceAndVerifyOwnership(
+        "group_ownership",
+        ImmutableMap.of(
+            HiveCatalog.HMS_DB_OWNER,
+            "iceberg",
+            HiveCatalog.HMS_DB_OWNER_TYPE,
+            PrincipalType.GROUP.name()),
+        "iceberg",
+        PrincipalType.GROUP);
+
+    createNamespaceAndVerifyOwnership(
+        "default_ownership_1",
+        ImmutableMap.of(),
+        System.getProperty("user.name"),
+        PrincipalType.USER);
+
+    createNamespaceAndVerifyOwnership(
+        "default_ownership_2",
+        ImmutableMap.of(HiveCatalog.HMS_DB_OWNER_TYPE, 
PrincipalType.USER.name()),

Review Comment:
   cool, taking



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