diff --git a/waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/FederatedHMSHandler.java b/waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/FederatedHMSHandler.java index 842bbd9fb..ec79ee39d 100644 --- a/waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/FederatedHMSHandler.java +++ b/waggle-dance-core/src/main/java/com/hotels/bdp/waggledance/server/FederatedHMSHandler.java @@ -1341,6 +1341,14 @@ public GrantRevokePrivilegeResponse grant_revoke_privileges(GrantRevokePrivilege public GrantRevokePrivilegeResponse refresh_privileges(HiveObjectRef hiveObjectRef, String authorizer, GrantRevokePrivilegeRequest grantRevokePrivilegeRequest) throws MetaException, TException { DatabaseMapping databaseMapping = checkWritePermissions(hiveObjectRef.getDbName()); + PrivilegeBag privilegeBag = grantRevokePrivilegeRequest.getPrivileges(); + if (privilegeBag != null && privilegeBag.getPrivileges() != null) { + for (HiveObjectPrivilege hiveObjectPrivilege : privilegeBag.getPrivileges()) { + if (hiveObjectPrivilege.getHiveObject() != null) { + databaseMapping.transformInboundHiveObjectRef(hiveObjectPrivilege.getHiveObject()); + } + } + } return databaseMapping.getClient().refresh_privileges(databaseMapping.transformInboundHiveObjectRef(hiveObjectRef), authorizer, grantRevokePrivilegeRequest); }