public static void checkDbAndTableFilters(boolean isFilterEnabled,
      MetaStoreFilterHook filterHook,
      final String catName, final String dbName, final String tblName)
      throws NoSuchObjectException, MetaException {

    if (catName == null) {
      throw new NullPointerException("catName is null");
    }

    if (isBlank(catName)) {
      throw new NoSuchObjectException("catName is not valid");
    }

    if (dbName == null) {
      throw new NullPointerException("dbName is null");
    }

    if (isBlank(dbName)) {
      throw new NoSuchObjectException("dbName is not valid");
    }

    List<String> filteredDb = filterDbNamesIfEnabled(isFilterEnabled, filterHook,
        Collections.singletonList(dbName));

    if (filteredDb.isEmpty()) {
      throw new NoSuchObjectException("Database " + dbName + " does not exist");
    }

    if (tblName == null) {
      throw new NullPointerException("tblName is null");
    }

    if (isBlank(tblName)) {
      throw new NoSuchObjectException("tblName is not valid");
    }

    List<String> filteredTable =
        filterTableNamesIfEnabled(isFilterEnabled, filterHook,
            catName, dbName, Collections.singletonList(tblName));
    if (filteredTable.isEmpty()) {
      throw new NoSuchObjectException("Table " + tblName + " does not exist");
    }
  }
Check if the current user has access to a given database and table name. Throw
NoSuchObjectException if user has no access. When the db or table is filtered out, we don't need
to even fetch the partitions. Therefore this check ensures table-level security and
could improve performance when filtering partitions.
@param dbName the database name
@param tblName the table name contained in the database
@throws NoSuchObjectException if the database or table is filtered out
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java