The default `WHERE' filter for automatically generated SQL queries is returned (#16608)

* Returned the default `WHERE` filter for auto-generated SQL queries

* Checkstyle fix

---------

Co-authored-by: sviatahorau <mikhail.sviatahorau@deep.bi>
This commit is contained in:
Misha 2024-06-24 17:52:35 +02:00 committed by GitHub
parent 990fd5f5fb
commit 354a3bea0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import { Button, ButtonGroup, Intent, Menu, MenuDivider, MenuItem } from '@bluep
import { IconNames } from '@blueprintjs/icons';
import { Popover2 } from '@blueprintjs/popover2';
import type { SqlQuery } from '@druid-toolkit/query';
import { SqlExpression } from '@druid-toolkit/query';
import classNames from 'classnames';
import copy from 'copy-to-clipboard';
import React from 'react';
@ -63,6 +64,8 @@ import { WorkbenchHistoryDialog } from './workbench-history-dialog/workbench-his
import './workbench-view.scss';
const LAST_DAY = SqlExpression.parse(`__time >= CURRENT_TIMESTAMP - INTERVAL '1' DAY`);
function cleanupTabEntry(tabEntry: TabEntry): void {
const discardedId = tabEntry.id;
WorkbenchRunningPromises.deletePromise(discardedId);
@ -786,6 +789,7 @@ export class WorkbenchView extends React.PureComponent<WorkbenchViewProps, Workb
columnMetadata={columnMetadataState.data}
onQueryChange={this.handleSqlQueryChange}
defaultSchema={defaultSchema ? defaultSchema : 'druid'}
defaultWhere={LAST_DAY}
defaultTable={defaultTable}
highlightTable={undefined}
/>