@Override
  public int execute() throws HiveException, IOException {
    HiveAuthorizer authorizer = PrivilegeUtils.getSessionAuthorizer(context.getConf());
    List<String> roleNames = authorizer.getCurrentRoleNames();
    PrivilegeUtils.writeListToFileAfterSort(roleNames, desc.getResFile(), context);

    return 0;
  }
Operation process of showing the current role.
ql/src/java/org/apache/hadoop/hive/ql/ddl/privilege/role/show/ShowCurrentRoleOperation.java