You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by vo...@apache.org on 2024/06/24 15:52:40 UTC
(druid) branch master updated: The default `WHERE' filter for automatically generated SQL queries is returned (#16608)
This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 354a3bea0b7 The default `WHERE' filter for automatically generated SQL queries is returned (#16608)
354a3bea0b7 is described below
commit 354a3bea0b774d30266070f3c381719b99071c40
Author: Misha <mi...@gmail.com>
AuthorDate: Mon Jun 24 17:52:35 2024 +0200
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 <mi...@deep.bi>
---
web-console/src/views/workbench-view/workbench-view.tsx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/web-console/src/views/workbench-view/workbench-view.tsx b/web-console/src/views/workbench-view/workbench-view.tsx
index c251a50f19a..625c6c514c6 100644
--- a/web-console/src/views/workbench-view/workbench-view.tsx
+++ b/web-console/src/views/workbench-view/workbench-view.tsx
@@ -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}
/>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org