use of co.cask.cdap.explore.utils.TablesArgs in project cdap by caskdata.
the class ExploreHttpClient method getTables.
@Override
public QueryHandle getTables(@Nullable String catalog, @Nullable String schemaPattern, String tableNamePattern, @Nullable List<String> tableTypes) throws ExploreException, SQLException {
String body = GSON.toJson(new TablesArgs(catalog, schemaPattern, tableNamePattern, tableTypes));
String resource = String.format("namespaces/%s/data/explore/jdbc/tables", 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 tables. Reason: " + response);
}
Aggregations