@Test
  public void testGetTableObjects() throws Exception {
    String dbName = "db";
    List<String> tableNames = Arrays.asList("table1", "table2", "table3", "table4", "table5");

    // Setup
    silentDropDatabase(dbName);

    Set<Table> tablesUsed = new HashSet<>();
    new DatabaseBuilder()
        .setName(dbName)
        .create(client, conf);
    for (String tableName : tableNames) {
      tablesUsed.add(createTable(dbName, tableName));
    }
    createMaterializedView(dbName, "mv1", tablesUsed);

    // Test
    List<Table> tableObjs = client.getTableObjectsByName(dbName, tableNames);

    // Verify
    assertEquals(tableNames.size(), tableObjs.size());
    for(Table table : tableObjs) {
      assertTrue("tableNames doesn't contain " + table.getTableName().toLowerCase() + ", " + tableNames,
          tableNames.contains(table.getTableName().toLowerCase()));
    }

    // Cleanup
    client.dropDatabase(dbName, true, true, true);
  }
Test table objects can be retrieved in batches
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java