Skip to content

Commit

Permalink
ALS-7132: Revert change breaking query sync for dataframes (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 authored Aug 21, 2024
1 parent 1cdfd3e commit b222828
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,19 @@ private ResponseEntity _querySync(QueryRequest resultRequest) throws IOException

case DATAFRAME:
case SECRET_ADMIN_DATAFRAME:
QueryStatus status = query(resultRequest).getBody();
while (status.getResourceStatus().equalsIgnoreCase("RUNNING")
|| status.getResourceStatus().equalsIgnoreCase("PENDING")) {
status = queryStatus(UUID.fromString(status.getResourceResultId()), null);
}
log.info(status.toString());

AsyncResult result = queryService.getResultFor(status.getResourceResultId());
if (result.getStatus() == AsyncResult.Status.SUCCESS) {
result.getStream().open();
return queryOkResponse(new String(result.getStream().readAllBytes(), StandardCharsets.UTF_8), incomingQuery, MediaType.TEXT_PLAIN);
}
return ResponseEntity.status(400).contentType(MediaType.APPLICATION_JSON).body("Status : " + result.getStatus().name());

case CROSS_COUNT:
return queryOkResponse(countProcessor.runCrossCounts(incomingQuery), incomingQuery, MediaType.APPLICATION_JSON);
Expand Down

0 comments on commit b222828

Please sign in to comment.