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


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -437,6 +451,18 @@ private Table newHmsTable(TableMetadata metadata) {
             null,
             TableType.EXTERNAL_TABLE.toString());
 
+    // hive2 does not support setting table ownership type, therefore we leave 
it as
+    // a table property. Once upgraded to hive3, then we can simply set
+    // 
newTable.setOwnerType(PrincipalType.valueOf(metadata.get(HMS_TABLE_OWNER_TYPE)))
+    String ownerType = metadata.property(TableProperties.HMS_TABLE_OWNER_TYPE, 
null);
+    if (ownerType != null && 
ownerType.equalsIgnoreCase(PrincipalType.GROUP.name())) {
+      newTable
+          .getParameters()
+          .put(TableProperties.HMS_TABLE_OWNER_TYPE, 
PrincipalType.GROUP.name());

Review Comment:
   sure, I was originally think about if I simply put a string like `"GROUP"` 
down, the later readers will wonder why it's not `"Group"`, `"group"` or 
`"groups"`. This would demonstrate where the string value comes from. But yes, 
I'm good with just a plain string here.



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