String tableNamePrefix = (database != null) ? database + "." : "";
HttpResponse response = doGet(String.format("data/explore/tables/%s/info", tableNamePrefix + table));
if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
return parseJson(response, TableInfo.class);
} else if (HttpResponseStatus.NOT_FOUND.getCode() == response.getResponseCode()) {
throw new TableNotFoundException("Table " + tableNamePrefix + table + " not found.");
}
throw new ExploreException("Cannot get the schema of table " + tableNamePrefix + table +
". Reason: " + getDetails(response));
}