mehakmeet commented on code in PR #10834:
URL: https://github.com/apache/gravitino/pull/10834#discussion_r3137489892
##########
core/src/main/java/org/apache/gravitino/hook/TableHookDispatcher.java:
##########
@@ -79,13 +82,17 @@ public Table createTable(
ident, columns, comment, properties, partitions, distribution,
sortOrders, indexes);
// Set the creator as the owner of the table.
- OwnerDispatcher ownerManager =
GravitinoEnv.getInstance().ownerDispatcher();
- if (ownerManager != null) {
- ownerManager.setOwner(
- ident.namespace().level(0),
- NameIdentifierUtil.toMetadataObject(ident, Entity.EntityType.TABLE),
- PrincipalUtils.getCurrentUserName(),
- Owner.Type.USER);
+ try {
+ OwnerDispatcher ownerManager =
GravitinoEnv.getInstance().ownerDispatcher();
+ if (ownerManager != null) {
+ ownerManager.setOwner(
+ ident.namespace().level(0),
+ NameIdentifierUtil.toMetadataObject(ident,
Entity.EntityType.TABLE),
Review Comment:
Good catch!
--
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]