Web console: fix DQT import (#13159)

* fix dqt import

* update licenses

* update tests
This commit is contained in:
Vadim Ogievetsky 2022-09-30 09:31:06 -07:00 committed by GitHub
parent ce5f55e5ce
commit ebfe1c0c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 158 deletions

View File

@ -5653,7 +5653,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Imply Data
version: 0.14.24
version: 0.15.1
---
@ -5722,7 +5722,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Ruben Verborgh
version: 1.14.7
version: 1.15.1
license_file_path: licenses/bin/follow-redirects.MIT
---

View File

@ -22,7 +22,7 @@
"d3-axis": "^1.0.12",
"d3-scale": "^3.2.0",
"d3-selection": "^1.4.0",
"druid-query-toolkit": "^0.14.24",
"druid-query-toolkit": "^0.15.1",
"file-saver": "^2.0.2",
"follow-redirects": "^1.14.7",
"fontsource-open-sans": "^3.0.9",
@ -8956,9 +8956,9 @@
}
},
"node_modules/druid-query-toolkit": {
"version": "0.14.24",
"resolved": "https://registry.npmjs.org/druid-query-toolkit/-/druid-query-toolkit-0.14.24.tgz",
"integrity": "sha512-NBV9prXllZiiYLCfD/k5UmJZg7EU7aqsQPIfTYiYgl9XY4QheY4IO8c5mD7lW8qPpS2qEr4mM9CXjGPPZTQrmw==",
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/druid-query-toolkit/-/druid-query-toolkit-0.15.1.tgz",
"integrity": "sha512-yklAD1Ksokh2s+llEaR/lvvMHjW6CgdCG7X+JFnWsttM/xITpTFMu4Zo5/MqVvoo9021/deg87QQMCOKNfo3wQ==",
"dependencies": {
"tslib": "^2.3.1"
},
@ -34562,9 +34562,9 @@
}
},
"druid-query-toolkit": {
"version": "0.14.24",
"resolved": "https://registry.npmjs.org/druid-query-toolkit/-/druid-query-toolkit-0.14.24.tgz",
"integrity": "sha512-NBV9prXllZiiYLCfD/k5UmJZg7EU7aqsQPIfTYiYgl9XY4QheY4IO8c5mD7lW8qPpS2qEr4mM9CXjGPPZTQrmw==",
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/druid-query-toolkit/-/druid-query-toolkit-0.15.1.tgz",
"integrity": "sha512-yklAD1Ksokh2s+llEaR/lvvMHjW6CgdCG7X+JFnWsttM/xITpTFMu4Zo5/MqVvoo9021/deg87QQMCOKNfo3wQ==",
"requires": {
"tslib": "^2.3.1"
}

View File

@ -79,7 +79,7 @@
"d3-axis": "^1.0.12",
"d3-scale": "^3.2.0",
"d3-selection": "^1.4.0",
"druid-query-toolkit": "^0.14.24",
"druid-query-toolkit": "^0.15.1",
"file-saver": "^2.0.2",
"follow-redirects": "^1.14.7",
"fontsource-open-sans": "^3.0.9",

View File

@ -22,12 +22,12 @@ import {
SqlFunction,
SqlLiteral,
SqlOrderByClause,
SqlOrderByExpression,
SqlPartitionedByClause,
SqlQuery,
SqlRef,
SqlTableRef,
} from 'druid-query-toolkit';
import { SqlOrderByExpression } from 'druid-query-toolkit/build/sql/sql-clause/sql-order-by-expression/sql-order-by-expression';
import Hjson from 'hjson';
import * as JSONBig from 'json-bigint-native';
import { v4 as uuidv4 } from 'uuid';

View File

@ -7,79 +7,7 @@ exports[`QueryView matches snapshot 1`] = `
<ColumnTree
columnMetadataLoading={true}
defaultSchema="druid"
defaultWhere={
SqlComparison {
"decorator": undefined,
"keywords": Object {
"op": ">=",
},
"lhs": SqlRef {
"columnRefName": RefName {
"name": "__time",
"quotes": false,
},
"keywords": Object {},
"namespaceRefName": undefined,
"spacing": Object {},
"tableRefName": undefined,
"type": "ref",
},
"negated": false,
"op": ">=",
"rhs": SqlMulti {
"args": SeparatedArray {
"separators": Array [
Separator {
"left": " ",
"right": " ",
"separator": "-",
},
],
"values": Array [
SqlFunction {
"args": undefined,
"decorator": undefined,
"functionName": "CURRENT_TIMESTAMP",
"keywords": Object {
"functionName": "CURRENT_TIMESTAMP",
},
"spacing": Object {},
"specialParen": "none",
"type": "function",
"whereClause": undefined,
},
SqlInterval {
"intervalValue": SqlLiteral {
"keywords": Object {},
"spacing": Object {},
"stringValue": "'1'",
"type": "literal",
"value": "1",
},
"keywords": Object {
"interval": "INTERVAL",
},
"spacing": Object {
"postInterval": " ",
"postIntervalValue": " ",
},
"type": "interval",
"unit": "DAY",
},
],
},
"keywords": Object {},
"op": "-",
"spacing": Object {},
"type": "multi",
},
"spacing": Object {
"postOp": " ",
"preOp": " ",
},
"type": "comparison",
}
}
defaultWhere={"__time >= CURRENT_TIMESTAMP - INTERVAL '1' DAY"}
getParsedQuery={[Function]}
onQueryChange={[Function]}
/>
@ -160,79 +88,7 @@ exports[`QueryView matches snapshot with query 1`] = `
<ColumnTree
columnMetadataLoading={true}
defaultSchema="druid"
defaultWhere={
SqlComparison {
"decorator": undefined,
"keywords": Object {
"op": ">=",
},
"lhs": SqlRef {
"columnRefName": RefName {
"name": "__time",
"quotes": false,
},
"keywords": Object {},
"namespaceRefName": undefined,
"spacing": Object {},
"tableRefName": undefined,
"type": "ref",
},
"negated": false,
"op": ">=",
"rhs": SqlMulti {
"args": SeparatedArray {
"separators": Array [
Separator {
"left": " ",
"right": " ",
"separator": "-",
},
],
"values": Array [
SqlFunction {
"args": undefined,
"decorator": undefined,
"functionName": "CURRENT_TIMESTAMP",
"keywords": Object {
"functionName": "CURRENT_TIMESTAMP",
},
"spacing": Object {},
"specialParen": "none",
"type": "function",
"whereClause": undefined,
},
SqlInterval {
"intervalValue": SqlLiteral {
"keywords": Object {},
"spacing": Object {},
"stringValue": "'1'",
"type": "literal",
"value": "1",
},
"keywords": Object {
"interval": "INTERVAL",
},
"spacing": Object {
"postInterval": " ",
"postIntervalValue": " ",
},
"type": "interval",
"unit": "DAY",
},
],
},
"keywords": Object {},
"op": "-",
"spacing": Object {},
"type": "multi",
},
"spacing": Object {
"postOp": " ",
"preOp": " ",
},
"type": "comparison",
}
}
defaultWhere={"__time >= CURRENT_TIMESTAMP - INTERVAL '1' DAY"}
getParsedQuery={[Function]}
onQueryChange={[Function]}
/>

View File

@ -158,7 +158,7 @@ export const StringMenuItems = React.memo(function StringMenuItems(props: String
return (
<MenuItem icon={IconNames.FUNCTION} text="Aggregate">
{aggregateMenuItem(SqlFunction.decorated('COUNT', 'DISTINCT', [ref]), `dist_${columnName}`)}
{aggregateMenuItem(SqlFunction.countDistinct(ref), `dist_${columnName}`)}
{aggregateMenuItem(
SqlFunction.COUNT_STAR.addWhereExpression(ref.equal(EMPTY_LITERAL)),
`filtered_dist_${columnName}`,