cryptoe commented on code in PR #16107:
URL: https://github.com/apache/druid/pull/16107#discussion_r1522446939
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -462,9 +462,27 @@ public TaskStatus runTask(final Closer closer)
log.warn("Worker: %s", MSQTasks.errorReportToLogMessage(workerError));
}
}
-
+ MSQResultsReport resultsReport = null;
if (queryKernel != null && queryKernel.isSuccess()) {
// If successful, encourage the tasks to exit successfully.
+ // get results before posting finish to the tasks.
+ if (resultsYielder != null) {
+ resultsReport = makeResultsTaskReport(
+ queryDef,
+ resultsYielder,
+ task.getQuerySpec().getColumnMappings(),
+ task.getSqlTypeNames(),
+
MultiStageQueryContext.getSelectDestination(task.getQuerySpec().getQuery().context())
+ );
+ try {
+ resultsYielder.close();
+ }
+ catch (IOException e) {
+ throw new RuntimeException("Unable to fetch results of various
worker tasks successfully", e);
Review Comment:
I can probably refactor this part of a another PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]