use of co.cask.cdap.explore.utils.SchemasArgs in project cdap by caskdata.
the class ExploreHttpClient method getSchemas.
@Override
public QueryHandle getSchemas(@Nullable String catalog, @Nullable String schemaPattern) throws ExploreException, SQLException {
String body = GSON.toJson(new SchemasArgs(catalog, schemaPattern));
String resource = String.format("namespaces/%s/data/explore/jdbc/schemas", schemaPattern);
HttpResponse response = doPost(resource, body, null);
if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
}
throw new ExploreException("Cannot get the schemas. Reason: " + response);
}
Aggregations