diff --git a/web-console/src/utils/download-query-detail-archive.ts b/web-console/src/utils/download-query-detail-archive.ts index 124b322c5fb0..cf84fc1acd29 100644 --- a/web-console/src/utils/download-query-detail-archive.ts +++ b/web-console/src/utils/download-query-detail-archive.ts @@ -18,6 +18,11 @@ import * as JSONBig from 'json-bigint-native'; +import type { + AsyncStatusResponse, + MsqTaskPayloadResponse, + MsqTaskReportResponse, +} from '../druid-models'; import { Api } from '../singletons'; import { downloadFile } from './download'; @@ -26,9 +31,9 @@ export interface QueryDetailArchive { id: string; detailArchiveVersion: number; status?: any; - reports?: any; - payload?: any; - statementsStatus?: any; + reports?: MsqTaskReportResponse; + payload?: MsqTaskPayloadResponse; + statementsStatus?: AsyncStatusResponse; serverStatus?: any; } diff --git a/web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx b/web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx index 3a563df1c947..020d01e8f778 100644 --- a/web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx +++ b/web-console/src/views/workbench-view/execution-submit-dialog/execution-submit-dialog.tsx @@ -82,9 +82,27 @@ export const ExecutionSubmitDialog = React.memo(function ExecutionSubmitDialog( if (typeof detailArchiveVersion === 'number') { try { if (detailArchiveVersion === 2) { - execution = Execution.fromTaskReport(parsed.reports) - .updateWithTaskPayload(parsed.payload) - .updateWithAsyncStatus(parsed.statementsStatus); + if (parsed.reports) { + execution = Execution.fromTaskReport(parsed.reports); + } + + if (parsed.statementsStatus) { + execution = execution + ? execution.updateWithAsyncStatus(parsed.statementsStatus) + : Execution.fromAsyncStatus(parsed.statementsStatus); + } + + if (!execution) { + AppToaster.show({ + intent: Intent.DANGER, + message: `Not enough information to decode detail archive`, + }); + return; + } + + if (parsed.payload) { + execution = execution.updateWithTaskPayload(parsed.payload); + } } else { AppToaster.show({ intent: Intent.DANGER, @@ -97,6 +115,7 @@ export const ExecutionSubmitDialog = React.memo(function ExecutionSubmitDialog( intent: Intent.DANGER, message: `Could not decode profile: ${e.message}`, }); + console.log(e); // Log out the error to the console in case we want to debug this further. This is very much a power user feature. return; } } else if (typeof (parsed as any).multiStageQuery === 'object') {