haizhou-zhao commented on code in PR #6045: URL: https://github.com/apache/iceberg/pull/6045#discussion_r1004726357
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java: ########## @@ -532,13 +536,27 @@ Database convertToDatabase(Namespace namespace, Map<String, String> meta) { database.setName(namespace.level(0)); database.setLocationUri(databaseLocation(namespace.level(0))); + // default ownership is determined from Hadoop.UGI.currentUser Review Comment: Your concern make sense. Currently, `convertToDatabase` is used by `createNamespace`, `setProperties` and `removeProperties`. Here is the change I propose: 1. HiveCatalog.class should expose a public method named `setOwnership`, it helps user setting ownership either at creation time or if they intentionally want ownership change for a namespace. Like `setProperties`, `setOwnership` can be only invoked on existing `Namespaces` 2. Under the hood, only `createNamespace` and `setOwnership` can set/alter ownership; `setProperties` and `removeProperties` cannot change ownership in anyway a. If user attempts to change ownership with `setProperties` and `removeProperties`, then they should explicitly get a RuntimeException. I'm against just silently ignoring users' attempts to change ownership with `setProperties` and `removeProperties` because that does not foster the right user behavior. Let me know what you think. -- 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