diff --git a/web-console/src/druid-models/query-context/query-context.tsx b/web-console/src/druid-models/query-context/query-context.tsx index a25d268d845..4b0367c25a6 100644 --- a/web-console/src/druid-models/query-context/query-context.tsx +++ b/web-console/src/druid-models/query-context/query-context.tsx @@ -40,6 +40,7 @@ export interface QueryContext { sqlJoinAlgorithm?: SqlJoinAlgorithm; failOnEmptyInsert?: boolean; waitUntilSegmentsLoad?: boolean; + useConcurrentLocks?: boolean; [key: string]: any; } @@ -61,6 +62,7 @@ export const DEFAULT_SERVER_QUERY_CONTEXT: QueryContext = { sqlJoinAlgorithm: 'broadcast', failOnEmptyInsert: false, waitUntilSegmentsLoad: false, + useConcurrentLocks: false, }; export interface QueryWithContext { diff --git a/web-console/src/views/workbench-view/run-panel/__snapshots__/run-panel.spec.tsx.snap b/web-console/src/views/workbench-view/run-panel/__snapshots__/run-panel.spec.tsx.snap new file mode 100644 index 00000000000..8c7f4ec7a70 --- /dev/null +++ b/web-console/src/views/workbench-view/run-panel/__snapshots__/run-panel.spec.tsx.snap @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RunPanel matches snapshot on msq (auto) query 1`] = ` +
+ +
+ + + + + + +
+
+`; + +exports[`RunPanel matches snapshot on native (auto) query 1`] = ` +
+ +
+ + + +
+
+`; diff --git a/web-console/src/views/workbench-view/run-panel/run-panel.spec.tsx b/web-console/src/views/workbench-view/run-panel/run-panel.spec.tsx new file mode 100644 index 00000000000..5416984c3db --- /dev/null +++ b/web-console/src/views/workbench-view/run-panel/run-panel.spec.tsx @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { render } from '@testing-library/react'; +import React from 'react'; + +import { DEFAULT_SERVER_QUERY_CONTEXT, DRUID_ENGINES, WorkbenchQuery } from '../../../druid-models'; + +import { RunPanel } from './run-panel'; + +describe('RunPanel', () => { + it('matches snapshot on native (auto) query', () => { + const runPanel = ( + {}} + running={false} + onRun={() => {}} + queryEngines={DRUID_ENGINES} + clusterCapacity={9} + defaultQueryContext={DEFAULT_SERVER_QUERY_CONTEXT} + /> + ); + const { container } = render(runPanel); + expect(container.firstChild).toMatchSnapshot(); + }); + + it('matches snapshot on msq (auto) query', () => { + const runPanel = ( + {}} + running={false} + onRun={() => {}} + queryEngines={DRUID_ENGINES} + clusterCapacity={9} + defaultQueryContext={DEFAULT_SERVER_QUERY_CONTEXT} + /> + ); + const { container } = render(runPanel); + expect(container.firstChild).toMatchSnapshot(); + }); +}); diff --git a/web-console/src/views/workbench-view/run-panel/run-panel.tsx b/web-console/src/views/workbench-view/run-panel/run-panel.tsx index 9ed135da354..e329f9d383b 100644 --- a/web-console/src/views/workbench-view/run-panel/run-panel.tsx +++ b/web-console/src/views/workbench-view/run-panel/run-panel.tsx @@ -103,7 +103,6 @@ export interface RunPanelProps query: WorkbenchQuery; onQueryChange(query: WorkbenchQuery): void; running: boolean; - small?: boolean; onRun(preview: boolean): void | Promise; queryEngines: DruidEngine[]; clusterCapacity: number | undefined; @@ -120,7 +119,6 @@ export const RunPanel = React.memo(function RunPanel(props: RunPanelProps) { onRun, moreMenu, running, - small, queryEngines, clusterCapacity, defaultQueryContext, @@ -166,6 +164,11 @@ export const RunPanel = React.memo(function RunPanel(props: RunPanelProps) { queryContext, defaultQueryContext, ); + const useConcurrentLocks = getQueryContextKey( + 'useConcurrentLocks', + queryContext, + defaultQueryContext, + ); const finalizeAggregations = queryContext.finalizeAggregations; const waitUntilSegmentsLoad = queryContext.waitUntilSegmentsLoad; const groupByEnableMultiValueUnnesting = queryContext.groupByEnableMultiValueUnnesting; @@ -198,7 +201,6 @@ export const RunPanel = React.memo(function RunPanel(props: RunPanelProps) { }, [onRun]); const hotkeys = useMemo(() => { - if (small) return []; return [ { allowInInput: true, @@ -217,7 +219,7 @@ export const RunPanel = React.memo(function RunPanel(props: RunPanelProps) { onKeyDown: handlePreview, }, ]; - }, [small, handleRun, handlePreview]); + }, [handleRun, handlePreview]); useHotkeys(hotkeys); @@ -264,9 +266,7 @@ export const RunPanel = React.memo(function RunPanel(props: RunPanelProps) { icon={IconNames.CARET_RIGHT} onClick={() => void onRun(false)} text="Run" - intent={!emptyQuery && !small ? Intent.PRIMARY : undefined} - small={small} - minimal={small} + intent={!emptyQuery ? Intent.PRIMARY : undefined} /> {ingestMode && (