@Test
  public void testHMSServerWithFilter() throws Exception {
    MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_CLIENT_FILTER_ENABLED, false);
    MetastoreConf.setBoolVar(conf, ConfVars.METASTORE_SERVER_FILTER_ENABLED, true);
    DBNAME1 = "db_testHMSServerWithFilter_1";
    DBNAME2 = "db_testHMSServerWithFilter_2";
    creatEnv(conf);

    testFilterForDb(true);
    testFilterForTables(true);
    testFilterForPartition(true);
    testFilterForCompaction();
    testFilterForDataConnector();
  }
Enable the HMS server side filtering
Disable the HMS client side filtering in order to see HMS server filtering behavior
@throws Exception
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestFilterHooks.java