use of com.facebook.presto.client.QueryData in project presto by prestodb.
the class TableNameCompleter method queryMetadata.
private List<String> queryMetadata(String query) {
ImmutableList.Builder<String> cache = ImmutableList.builder();
try (StatementClient client = queryRunner.startInternalQuery(query)) {
while (client.isRunning() && !Thread.currentThread().isInterrupted()) {
QueryData results = client.currentData();
if (results.getData() != null) {
for (List<Object> row : results.getData()) {
cache.add((String) row.get(0));
}
}
client.advance();
}
}
return cache.build();
}
Aggregations