mirror of https://github.com/apache/druid.git
make sure execution mode is set (#14606)
This commit is contained in:
parent
cab93fb817
commit
0a8262edc8
|
@ -195,19 +195,14 @@ exports[`RuleEditor matches snapshot no tier in rule 1`] = `
|
||||||
test1
|
test1
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
value="test"
|
value="test2"
|
||||||
>
|
>
|
||||||
test
|
test2
|
||||||
</option>
|
</option>
|
||||||
<option
|
<option
|
||||||
value="test"
|
value="test3"
|
||||||
>
|
>
|
||||||
test
|
test3
|
||||||
</option>
|
|
||||||
<option
|
|
||||||
value="test"
|
|
||||||
>
|
|
||||||
test
|
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<span
|
<span
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('RuleEditor', () => {
|
||||||
const ruleEditor = (
|
const ruleEditor = (
|
||||||
<RuleEditor
|
<RuleEditor
|
||||||
rule={{ type: 'loadForever', tieredReplicants: { test1: 1 } }}
|
rule={{ type: 'loadForever', tieredReplicants: { test1: 1 } }}
|
||||||
tiers={['test', 'test', 'test']}
|
tiers={['test1', 'test2', 'test3']}
|
||||||
onChange={() => {}}
|
onChange={() => {}}
|
||||||
onDelete={() => {}}
|
onDelete={() => {}}
|
||||||
moveUp={undefined}
|
moveUp={undefined}
|
||||||
|
|
|
@ -36,6 +36,15 @@ const USE_TASK_REPORTS = true;
|
||||||
const WAIT_FOR_SEGMENT_METADATA_TIMEOUT = 180000; // 3 minutes to wait until segments appear in the metadata
|
const WAIT_FOR_SEGMENT_METADATA_TIMEOUT = 180000; // 3 minutes to wait until segments appear in the metadata
|
||||||
const WAIT_FOR_SEGMENT_LOAD_TIMEOUT = 540000; // 9 minutes to wait for segments to load at all
|
const WAIT_FOR_SEGMENT_LOAD_TIMEOUT = 540000; // 9 minutes to wait for segments to load at all
|
||||||
|
|
||||||
|
// some executionMode has to be set on the /druid/v2/sql/statements API
|
||||||
|
function ensureExecutionModeIsSet(context: QueryContext | undefined): QueryContext {
|
||||||
|
if (typeof context?.executionMode === 'string') return context;
|
||||||
|
return {
|
||||||
|
...context,
|
||||||
|
executionMode: 'async',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface SubmitTaskQueryOptions {
|
export interface SubmitTaskQueryOptions {
|
||||||
query: string | Record<string, any>;
|
query: string | Record<string, any>;
|
||||||
context?: QueryContext;
|
context?: QueryContext;
|
||||||
|
@ -65,26 +74,22 @@ export async function submitTaskQuery(
|
||||||
sqlQuery = query;
|
sqlQuery = query;
|
||||||
jsonQuery = {
|
jsonQuery = {
|
||||||
query: sqlQuery,
|
query: sqlQuery,
|
||||||
|
context: ensureExecutionModeIsSet(context),
|
||||||
resultFormat: 'array',
|
resultFormat: 'array',
|
||||||
header: true,
|
header: true,
|
||||||
typesHeader: true,
|
typesHeader: true,
|
||||||
sqlTypesHeader: true,
|
sqlTypesHeader: true,
|
||||||
context: context,
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
sqlQuery = query.query;
|
sqlQuery = query.query;
|
||||||
|
|
||||||
if (context) {
|
jsonQuery = {
|
||||||
jsonQuery = {
|
...query,
|
||||||
...query,
|
context: ensureExecutionModeIsSet({
|
||||||
context: {
|
...query.context,
|
||||||
...(query.context || {}),
|
...context,
|
||||||
...context,
|
}),
|
||||||
},
|
};
|
||||||
};
|
|
||||||
} else {
|
|
||||||
jsonQuery = query;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let sqlAsyncResp: AxiosResponse<AsyncStatusResponse>;
|
let sqlAsyncResp: AxiosResponse<AsyncStatusResponse>;
|
||||||
|
|
Loading…
Reference in New Issue