public static Table filterTableIfEnabled(
      boolean isFilterEnabled, MetaStoreFilterHook filterHook, Table table)
      throws MetaException, NoSuchObjectException {
    if (isFilterEnabled) {
      Table filteredTable = filterHook.filterTable(table);

      if (filteredTable == null) {
        throw new NoSuchObjectException("Table " + table.getDbName() + "." +
            table.getTableName() + " not found.");
      }
    }

    return table;
  }
Filter the table if filtering is enabled. Otherwise, return original table object
@param isFilterEnabled true: filtering is enabled; false: filtring is disabled.
@param filterHook: the object that does filtering
@param table: the table object from Hive meta data
@return the table object if user has access or filtering is disabled;
        throw NoSuchObjectException if user does not have access to this table
@throws MetaException
@throws NoSuchObjectException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java