Skip to content

Commit

Permalink
remove SQL mode detection (#17619)
Browse files Browse the repository at this point in the history
  • Loading branch information
vogievetsky authored Jan 14, 2025
1 parent c3e5977 commit 55022db
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 238 deletions.
2 changes: 1 addition & 1 deletion web-console/src/dialogs/status-dialog/status-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const StatusDialog = React.memo(function StatusDialog(props: StatusDialog
return (
<div className="main-container">
<div className="version">
Version: <strong>{response.version}</strong>
Druid version: <strong>{response.version}</strong>
</div>
<ReactTable
data={response.modules}
Expand Down
1 change: 0 additions & 1 deletion web-console/src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export * from './general';
export * from './local-storage-backed-visibility';
export * from './local-storage-keys';
export * from './mouse-tooltip/mouse-tooltip';
export * from './null-mode-detection';
export * from './object-change';
export * from './query-action';
export * from './query-manager';
Expand Down
154 changes: 0 additions & 154 deletions web-console/src/utils/null-mode-detection.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,7 @@ exports[`HomeView matches snapshot (coordinator) 1`] = `
<div
className="home-view app-view"
>
<Memo(StatusCard)
capabilities={
Capabilities {
"coordinator": true,
"maxTaskSlots": undefined,
"multiStageQueryDart": false,
"multiStageQueryTask": false,
"overlord": false,
"queryType": "none",
}
}
/>
<Memo(StatusCard) />
<React.Fragment>
<Memo(DatasourcesCard)
capabilities={
Expand Down Expand Up @@ -73,18 +62,7 @@ exports[`HomeView matches snapshot (full) 1`] = `
<div
className="home-view app-view"
>
<Memo(StatusCard)
capabilities={
Capabilities {
"coordinator": true,
"maxTaskSlots": undefined,
"multiStageQueryDart": true,
"multiStageQueryTask": true,
"overlord": true,
"queryType": "nativeAndSql",
}
}
/>
<Memo(StatusCard) />
<React.Fragment>
<Memo(DatasourcesCard)
capabilities={
Expand Down Expand Up @@ -168,18 +146,7 @@ exports[`HomeView matches snapshot (overlord) 1`] = `
<div
className="home-view app-view"
>
<Memo(StatusCard)
capabilities={
Capabilities {
"coordinator": false,
"maxTaskSlots": undefined,
"multiStageQueryDart": false,
"multiStageQueryTask": false,
"overlord": true,
"queryType": "none",
}
}
/>
<Memo(StatusCard) />
<React.Fragment>
<Memo(SupervisorsCard)
capabilities={
Expand Down
4 changes: 0 additions & 4 deletions web-console/src/views/home-view/home-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,4 @@
@media (max-width: 600px) {
grid-template-columns: 1fr;
}

.tooltip-info {
text-decoration: underline dotted;
}
}
2 changes: 1 addition & 1 deletion web-console/src/views/home-view/home-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const HomeView = React.memo(function HomeView(props: HomeViewProps) {

return (
<div className="home-view app-view">
<StatusCard capabilities={capabilities} />
<StatusCard />
{capabilities.hasSqlOrCoordinatorAccess() && (
<>
<DatasourcesCard capabilities={capabilities} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@

import { render } from '@testing-library/react';

import { Capabilities } from '../../../helpers';

import { StatusCard } from './status-card';

describe('StatusCard', () => {
it('matches snapshot', () => {
const statusCard = <StatusCard capabilities={Capabilities.FULL} />;
const statusCard = <StatusCard />;

const { container } = render(statusCard);
expect(container.firstChild).toMatchSnapshot();
Expand Down
43 changes: 5 additions & 38 deletions web-console/src/views/home-view/status-card/status-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,17 @@ import { IconNames } from '@blueprintjs/icons';
import React, { useState } from 'react';

import { StatusDialog } from '../../../dialogs/status-dialog/status-dialog';
import type { Capabilities } from '../../../helpers';
import { useQueryManager } from '../../../hooks';
import { Api } from '../../../singletons';
import type { NullModeDetection } from '../../../utils';
import {
deepGet,
explainNullModeDetection,
NULL_DETECTION_QUERY,
nullDetectionQueryResultDecoder,
pluralIfNeeded,
queryDruidRune,
summarizeNullModeDetection,
} from '../../../utils';
import { pluralIfNeeded } from '../../../utils';
import { HomeViewCard } from '../home-view-card/home-view-card';

interface StatusSummary {
version: string;
extensionCount: number;
}

export interface StatusCardProps {
capabilities: Capabilities;
}

export const StatusCard = React.memo(function StatusCard(props: StatusCardProps) {
const { capabilities } = props;
export const StatusCard = React.memo(function StatusCard() {
const [showStatusDialog, setShowStatusDialog] = useState(false);
const [statusSummaryState] = useQueryManager<null, StatusSummary>({
initQuery: null,
Expand All @@ -58,17 +43,7 @@ export const StatusCard = React.memo(function StatusCard(props: StatusCardProps)
},
});

const [nullModeDetectionState] = useQueryManager<Capabilities, NullModeDetection>({
initQuery: capabilities,
processQuery: async (capabilities, cancelToken) => {
if (!capabilities.hasQuerying()) return {};
const nullDetectionResponse = await queryDruidRune(NULL_DETECTION_QUERY, cancelToken);
return nullDetectionQueryResultDecoder(deepGet(nullDetectionResponse, '0.result'));
},
});

const statusSummary = statusSummaryState.data;
const nullModeDetection = nullModeDetectionState.data;
return (
<>
<HomeViewCard
Expand All @@ -87,17 +62,9 @@ export const StatusCard = React.memo(function StatusCard(props: StatusCardProps)
<p>{`${pluralIfNeeded(statusSummary.extensionCount, 'extension')} loaded`}</p>
</>
)}
{nullModeDetection && (
<p
className="tooltip-info"
data-tooltip={[
'Null related server properties',
...explainNullModeDetection(nullModeDetection),
].join('\n')}
>
{summarizeNullModeDetection(nullModeDetection)}
</p>
)}
<p data-tooltip="This version of Druid only supports the SQL compliant querying mode.">
SQL compliant NULL mode (built-in)
</p>
</HomeViewCard>
{showStatusDialog && (
<StatusDialog
Expand Down

0 comments on commit 55022db

Please sign in to comment.