class HCatalogBeamSchema {

  public Optional<Schema> getTableSchema(String db, String table) {
    try {
      org.apache.hadoop.hive.metastore.api.Table metastoreTable = metastore.getTable(db, table);
      List<FieldSchema> fields = Lists.newArrayList(metastoreTable.getSd().getCols());
      fields.addAll(metastoreTable.getPartitionKeys());
      Schema schema = SchemaUtils.toBeamSchema(fields);
      return Optional.of(schema);
    } catch (NoSuchObjectException e) {
      return Optional.absent();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  private  HCatalogBeamSchema(IMetaStoreClient metastore);

}