@Override
  public GetFunctionsResponse get_functions_req(GetFunctionsRequest req)
      throws MetaException {
    startFunction("get_functions_req", ": db=" + req.getDbName()
        + " pat=" + req.getPattern());

    RawStore ms = getMS();
    Exception ex = null;
    List<Function> funcs = null;
    String catName = req.isSetCatalogName() ? req.getCatalogName() : getDefaultCatalog(conf);
    try {
      funcs = ms.getFunctionsRequest(catName, req.getDbName(),
          req.getPattern(), req.isReturnNames());
    } catch (Exception e) {
      ex = e;
      throw newMetaException(e);
    } finally {
      endFunction("get_functions", funcs != null, ex);
    }
    GetFunctionsResponse response = new GetFunctionsResponse();
    response.setFunctions(funcs);

    return response;
  }
Check if newRole is in parent hierarchy of curRole
@param newRole
@param curRole
@return true if newRole is curRole or present in its hierarchy
@throws MetaException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java