Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions web-console/src/utils/download-query-detail-archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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') {
Expand Down