@Override
      public boolean hasNext() {
        return ((batchIter != null) && batchIter.hasNext()) || tableNamesIter.hasNext();
      }
Use this to get Table objects for a table list. It provides an iterator to
on the resulting Table objects. It batches the calls to
IMetaStoreClient.getTableObjectsByName to avoid OOM issues in HS2 (with
embedded metastore) or MetaStore server (if HS2 is using remote metastore).
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/TableIterable.java