mirror of https://github.com/apache/druid.git
make detail archive opening more robust (#16071)
This commit is contained in:
parent
775c1180ae
commit
19a8af866b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue