Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down Expand Up @@ -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

---
Expand Down
14 changes: 7 additions & 7 deletions web-console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
SqlPartitionedByClause,
SqlQuery,
SqlReplaceClause,
SqlTable,
SqlWithPart,
T,
} from '@druid-toolkit/query';
Expand Down Expand Up @@ -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`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export const TimeIntervalFilterControl = React.memo(function TimeIntervalFilterC
negated,
column,
start,
startBound: '[',
end,
endBound: ')',
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -86,7 +86,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Hour',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'PT1H',
rangeDuration: 'PT1H',
Expand All @@ -95,7 +95,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Day',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'P1D',
rangeDuration: 'P1D',
Expand All @@ -104,7 +104,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Week',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'ceil',
alignDuration: 'P1W',
rangeDuration: 'P1W',
Expand All @@ -118,7 +118,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Hour',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'PT1H',
rangeDuration: 'PT1H',
Expand All @@ -127,7 +127,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Day',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'P1D',
rangeDuration: 'P1D',
Expand All @@ -136,7 +136,7 @@ const GROUPS: GroupedNamedPartialPatterns[] = [
{
name: 'Week',
partialPattern: {
anchor: 'currentTimestamp',
anchor: 'timestamp',
alignType: 'floor',
alignDuration: 'P1W',
rangeDuration: 'P1W',
Expand Down Expand Up @@ -182,6 +182,8 @@ export const TimeRelativeFilterControl = React.memo(function TimeRelativeFilterC
negated,
column,
...partialPattern,
startBound: '[',
endBound: ')',
});
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export function initPatternForColumn(column: ExpressionMeta): FilterPattern {
column: column.name,
anchor: 'maxDataTime',
rangeDuration: 'P1D',
startBound: '[',
endBound: ')',
};

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
}
Expand Down