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