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 195221ca592 Web console: update druid-toolkit to get bug fixes (#16213)
195221ca592 is described below
commit 195221ca5925910353086fbf851b42028e00b778
Author: Vadim Ogievetsky <[email protected]>
AuthorDate: Fri Mar 29 08:31:35 2024 -0700
Web console: update druid-toolkit to get bug fixes (#16213)
* update druid-toolkit to get bug fixes
* update
* fix test
---
licenses.yaml | 4 ++--
web-console/package-lock.json | 14 +++++++-------
web-console/package.json | 2 +-
.../__snapshots__/compaction-config-dialog.spec.tsx.snap | 15 +++++++++++++++
.../compaction-config-dialog.tsx | 9 ++++++++-
.../ingest-query-pattern/ingest-query-pattern.ts | 9 +++++++--
.../time-interval-filter-control.tsx | 2 ++
.../time-relative-filter-control.tsx | 16 +++++++++-------
.../views/explore-view/filter-pane/pattern-helpers.ts | 2 ++
.../views/sql-data-loader-view/sql-data-loader-view.tsx | 6 ++++--
.../string-menu-items/string-menu-items.tsx | 3 ++-
11 files changed, 59 insertions(+), 23 deletions(-)
diff --git a/licenses.yaml b/licenses.yaml
index 0d47694f6c4..4490b4f5da2 100644
--- a/licenses.yaml
+++ b/licenses.yaml
@@ -5086,7 +5086,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Imply Data
-version: 0.21.9
+version: 0.22.11
---
@@ -5799,7 +5799,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Ruben Verborgh
-version: 1.15.5
+version: 1.15.6
license_file_path: licenses/bin/follow-redirects.MIT
---
diff --git a/web-console/package-lock.json b/web-console/package-lock.json
index 69e3011c1db..886095d5f2e 100644
--- a/web-console/package-lock.json
+++ b/web-console/package-lock.json
@@ -14,7 +14,7 @@
"@blueprintjs/datetime2": "^0.9.35",
"@blueprintjs/icons": "^4.16.0",
"@blueprintjs/popover2": "^1.14.9",
- "@druid-toolkit/query": "^0.21.9",
+ "@druid-toolkit/query": "^0.22.11",
"@druid-toolkit/visuals-core": "^0.3.3",
"@druid-toolkit/visuals-react": "^0.3.3",
"ace-builds": "~1.4.14",
@@ -1004,9 +1004,9 @@
}
},
"node_modules/@druid-toolkit/query": {
- "version": "0.21.9",
- "resolved":
"https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.9.tgz",
- "integrity":
"sha512-g8bs9cOqyrxPzf1qdvO4FAG0rv7aBR2le+OLbF/n/KC3YXq49CUifPUYIHVfVx/jwoXKrJd1w1jVLES8OusnTg==",
+ "version": "0.22.11",
+ "resolved":
"https://registry.npmjs.org/@druid-toolkit/query/-/query-0.22.11.tgz",
+ "integrity":
"sha512-VVEn/tsEr9fb+8eKc+nu3/YH7l+LZ1vd0D32UDo66GLS3cI+EKOCM7VYC8lTvB1tAS+98w/EzfbdlRPlkSeOoQ==",
"dependencies": {
"tslib": "^2.5.2"
}
@@ -19146,9 +19146,9 @@
"dev": true
},
"@druid-toolkit/query": {
- "version": "0.21.9",
- "resolved":
"https://registry.npmjs.org/@druid-toolkit/query/-/query-0.21.9.tgz",
- "integrity":
"sha512-g8bs9cOqyrxPzf1qdvO4FAG0rv7aBR2le+OLbF/n/KC3YXq49CUifPUYIHVfVx/jwoXKrJd1w1jVLES8OusnTg==",
+ "version": "0.22.11",
+ "resolved":
"https://registry.npmjs.org/@druid-toolkit/query/-/query-0.22.11.tgz",
+ "integrity":
"sha512-VVEn/tsEr9fb+8eKc+nu3/YH7l+LZ1vd0D32UDo66GLS3cI+EKOCM7VYC8lTvB1tAS+98w/EzfbdlRPlkSeOoQ==",
"requires": {
"tslib": "^2.5.2"
}
diff --git a/web-console/package.json b/web-console/package.json
index 1818a50c430..a7c4c64e51d 100644
--- a/web-console/package.json
+++ b/web-console/package.json
@@ -68,7 +68,7 @@
"@blueprintjs/datetime2": "^0.9.35",
"@blueprintjs/icons": "^4.16.0",
"@blueprintjs/popover2": "^1.14.9",
- "@druid-toolkit/query": "^0.21.9",
+ "@druid-toolkit/query": "^0.22.11",
"@druid-toolkit/visuals-core": "^0.3.3",
"@druid-toolkit/visuals-react": "^0.3.3",
"ace-builds": "~1.4.14",
diff --git
a/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
b/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
index 5208fbf6de0..6df207060ff 100644
---
a/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
+++
b/web-console/src/dialogs/compaction-config-dialog/__snapshots__/compaction-config-dialog.spec.tsx.snap
@@ -1620,6 +1620,21 @@ exports[`CompactionConfigDialog matches snapshot without
compactionConfig 1`] =
onClick={[Function]}
text="History"
/>
+ <Blueprint4.Tooltip2
+ compact={false}
+ content="There is no compaction config currently set for this
datasource"
+ hoverCloseDelay={0}
+ hoverOpenDelay={100}
+ interactionKind="hover-target"
+ minimal={false}
+ transitionDuration={100}
+ >
+ <Blueprint4.Button
+ disabled={true}
+ intent="danger"
+ text="Delete"
+ />
+ </Blueprint4.Tooltip2>
<Blueprint4.Button
onClick={[Function]}
text="Close"
diff --git
a/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
b/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
index 6ff324f77fb..f07d0ce55ec 100644
---
a/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
+++
b/web-console/src/dialogs/compaction-config-dialog/compaction-config-dialog.tsx
@@ -17,6 +17,7 @@
*/
import { Button, Callout, Classes, Code, Dialog, Intent, Switch } from
'@blueprintjs/core';
+import { Tooltip2 } from '@blueprintjs/popover2';
import React, { useState } from 'react';
import type { FormJsonTabs } from '../../components';
@@ -162,7 +163,13 @@ export const CompactionConfigDialog = React.memo(function
CompactionConfigDialog
minimal
onClick={() => setShowHistory(true)}
/>
- {compactionConfig && <Button text="Delete" intent={Intent.DANGER}
onClick={onDelete} />}
+ {compactionConfig ? (
+ <Button text="Delete" intent={Intent.DANGER} onClick={onDelete} />
+ ) : (
+ <Tooltip2 content="There is no compaction config currently set for
this datasource">
+ <Button text="Delete" disabled intent={Intent.DANGER} />
+ </Tooltip2>
+ )}
<Button text="Close" onClick={onClose} />
<Button
text="Submit"
diff --git
a/web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts
b/web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts
index 6730ecec659..f0ce8a0eb28 100644
--- a/web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts
+++ b/web-console/src/druid-models/ingest-query-pattern/ingest-query-pattern.ts
@@ -23,6 +23,7 @@ import {
SqlPartitionedByClause,
SqlQuery,
SqlReplaceClause,
+ SqlTable,
SqlWithPart,
T,
} from '@druid-toolkit/query';
@@ -150,11 +151,15 @@ export function fitIngestQueryPattern(query: SqlQuery):
IngestQueryPattern {
let mode: IngestMode;
let overwriteWhere: SqlExpression | undefined;
if (query.insertClause) {
+ const { table } = query.insertClause;
+ if (!(table instanceof SqlTable)) throw new Error('Have to insert into a
table');
mode = 'insert';
- destinationTableName = query.insertClause.table.getName();
+ destinationTableName = table.getName();
} else if (query.replaceClause) {
+ const { table } = query.replaceClause;
+ if (!(table instanceof SqlTable)) throw new Error('Have to replace into a
table');
mode = 'replace';
- destinationTableName = query.replaceClause.table.getName();
+ destinationTableName = table.getName();
overwriteWhere = query.replaceClause.whereClause?.expression;
} else {
throw new Error(`Must have an INSERT or REPLACE clause`);
diff --git
a/web-console/src/views/explore-view/filter-pane/filter-menu/time-interval-filter-control/time-interval-filter-control.tsx
b/web-console/src/views/explore-view/filter-pane/filter-menu/time-interval-filter-control/time-interval-filter-control.tsx
index a7e2997d909..3a24bf69074 100644
---
a/web-console/src/views/explore-view/filter-pane/filter-menu/time-interval-filter-control/time-interval-filter-control.tsx
+++
b/web-console/src/views/explore-view/filter-pane/filter-menu/time-interval-filter-control/time-interval-filter-control.tsx
@@ -86,7 +86,9 @@ export const TimeIntervalFilterControl = React.memo(function
TimeIntervalFilterC
negated,
column,
start,
+ startBound: '[',
end,
+ endBound: ')',
};
}
diff --git
a/web-console/src/views/explore-view/filter-pane/filter-menu/time-relative-filter-control/time-relative-filter-control.tsx
b/web-console/src/views/explore-view/filter-pane/filter-menu/time-relative-filter-control/time-relative-filter-control.tsx
index 82ddfac7fd1..b7b0e63bc3a 100644
---
a/web-console/src/views/explore-view/filter-pane/filter-menu/time-relative-filter-control/time-relative-filter-control.tsx
+++
b/web-console/src/views/explore-view/filter-pane/filter-menu/time-relative-filter-control/time-relative-filter-control.tsx
@@ -24,7 +24,7 @@ import { ColumnPicker } from
'../../../column-picker/column-picker';
import type { Dataset } from '../../../utils';
interface PartialPattern {
- anchor: 'currentTimestamp' | 'maxDataTime';
+ anchor: 'timestamp' | 'maxDataTime';
rangeDuration: string;
alignType?: 'floor' | 'ceil';
alignDuration?: string;
@@ -86,7 +86,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Hour',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'PT1H',
rangeDuration: 'PT1H',
@@ -95,7 +95,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Day',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'P1D',
rangeDuration: 'P1D',
@@ -104,7 +104,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Week',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'P1W',
rangeDuration: 'P1W',
@@ -118,7 +118,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Hour',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'PT1H',
rangeDuration: 'PT1H',
@@ -127,7 +127,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Day',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'P1D',
rangeDuration: 'P1D',
@@ -136,7 +136,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Week',
partialPattern: {
- anchor: 'currentTimestamp',
+ anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'P1W',
rangeDuration: 'P1W',
@@ -182,6 +182,8 @@ export const TimeRelativeFilterControl =
React.memo(function TimeRelativeFilterC
negated,
column,
...partialPattern,
+ startBound: '[',
+ endBound: ')',
});
}}
/>
diff --git a/web-console/src/views/explore-view/filter-pane/pattern-helpers.ts
b/web-console/src/views/explore-view/filter-pane/pattern-helpers.ts
index b927095ce81..efac6f34c56 100644
--- a/web-console/src/views/explore-view/filter-pane/pattern-helpers.ts
+++ b/web-console/src/views/explore-view/filter-pane/pattern-helpers.ts
@@ -30,6 +30,8 @@ export function initPatternForColumn(column: ExpressionMeta):
FilterPattern {
column: column.name,
anchor: 'maxDataTime',
rangeDuration: 'P1D',
+ startBound: '[',
+ endBound: ')',
};
default:
diff --git
a/web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx
b/web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx
index 27017f725da..c07bdd4380f 100644
--- a/web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx
+++ b/web-console/src/views/sql-data-loader-view/sql-data-loader-view.tsx
@@ -19,7 +19,7 @@
import type { IconName } from '@blueprintjs/core';
import { Card, Icon, Intent } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
-import { SqlQuery } from '@druid-toolkit/query';
+import { SqlQuery, SqlTable } from '@druid-toolkit/query';
import type { JSX } from 'react';
import React, { useState } from 'react';
@@ -136,7 +136,9 @@ export const SqlDataLoaderView = React.memo(function
SqlDataLoaderView(
onBack={() => setContent(undefined)}
onDone={async () => {
const { queryString, queryContext } = content;
- const ingestDatasource =
SqlQuery.parse(queryString).getIngestTable()?.getName();
+ const ingestTable = SqlQuery.parse(queryString).getIngestTable();
+ const ingestDatasource =
+ ingestTable instanceof SqlTable ? ingestTable.getName() :
undefined;
if (!ingestDatasource) {
AppToaster.show({ message: `Must have an ingest datasource`,
intent: Intent.DANGER });
diff --git
a/web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx
b/web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx
index a32db7f8b65..8c95ffd15ce 100644
---
a/web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx
+++
b/web-console/src/views/workbench-view/column-tree/column-tree-menu/string-menu-items/string-menu-items.tsx
@@ -140,7 +140,8 @@ export const StringMenuItems = React.memo(function
StringMenuItems(props: String
`filtered_dist_${columnName}`,
false,
)}
- {aggregateMenuItem(F('LATEST', column, 100), `latest_${columnName}`)}
+ {aggregateMenuItem(F('ANY_VALUE', column), columnName)}
+ {aggregateMenuItem(F('LATEST', column), `latest_${columnName}`)}
</MenuItem>
);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]