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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 12 additions & 2 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5317,7 +5317,7 @@ license_category: binary
module: web-console
license_name: MIT License
copyright: Matt Zabriskie
version: 0.21.4
version: 0.26.1
license_file_path: licenses/bin/axios.MIT

---
Expand Down Expand Up @@ -5666,7 +5666,7 @@ license_category: binary
module: web-console
license_name: Apache License version 2.0
copyright: Imply Data
version: 0.14.10
version: 0.14.24

---

Expand Down Expand Up @@ -6536,4 +6536,14 @@ license_name: ISC License
copyright: Eemeli Aro
version: 1.10.2
license_file_path: licenses/bin/yaml.ISC

---

name: "zustand"
license_category: binary
module: web-console
license_name: MIT License
copyright: Paul Henschel
version: 3.7.2
license_file_path: licenses/bin/zustand.MIT
# Web console modules end
21 changes: 21 additions & 0 deletions licenses/bin/zustand.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Paul Henschel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion web-console/e2e-tests/component/datasources/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class DatasourcesOverview {
}

private async clickMoreButton(options: any): Promise<void> {
await this.page.click('//button[span[@icon="more"]]', options);
await this.page.click('.more-button button', options);
await this.waitForPopupMenu();
}
}
4 changes: 2 additions & 2 deletions web-console/e2e-tests/component/ingestion/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ enum TaskColumn {
GROUP_ID,
TYPE,
DATASOURCE,
LOCATION,
CREATED_TIME,
STATUS,
CREATED_TIME,
DURATION,
LOCATION,
}

/**
Expand Down
2 changes: 1 addition & 1 deletion web-console/e2e-tests/component/load-data/data-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class DataLoader {

constructor(props: DataLoaderProps) {
Object.assign(this, props);
this.baseUrl = props.unifiedConsoleUrl + '#load-data';
this.baseUrl = props.unifiedConsoleUrl + '#data-loader';
}

/**
Expand Down
13 changes: 6 additions & 7 deletions web-console/e2e-tests/component/query/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import * as playwright from 'playwright-chromium';

import { clickButton, clickText, setInput } from '../../util/playwright';
import { clickButton, clickText } from '../../util/playwright';
import { extractTable } from '../../util/table';

/**
Expand All @@ -37,8 +37,9 @@ export class QueryOverview {
await this.page.goto(this.baseUrl);
await this.page.reload({ waitUntil: 'networkidle' });

const input = await this.page.$('div.query-input textarea');
await setInput(input!, query);
const input = await this.page.waitForSelector('div.query-input textarea');
await input.fill(query);

await clickButton(this.page, 'Run');
await this.page.waitForSelector('div.query-info');

Expand All @@ -49,10 +50,8 @@ export class QueryOverview {
await this.page.goto(this.baseUrl);
await this.page.reload({ waitUntil: 'networkidle' });

await this.page.waitForSelector('div.query-input textarea');
const input = await this.page.$('div.query-input textarea');

await setInput(input!, query);
const input = await this.page.waitForSelector('div.query-input textarea');
await input.fill(query);

await Promise.all([
this.page.waitForRequest(
Expand Down
47 changes: 47 additions & 0 deletions web-console/e2e-tests/component/workbench/overview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as playwright from 'playwright-chromium';

import { clickButton } from '../../util/playwright';
import { extractTable } from '../../util/table';

/**
* Represents the workbench tab.
*/
export class WorkbenchOverview {
private readonly page: playwright.Page;
private readonly baseUrl: string;

constructor(page: playwright.Page, unifiedConsoleUrl: string) {
this.page = page;
this.baseUrl = unifiedConsoleUrl + '#workbench';
}

async runQuery(query: string): Promise<string[][]> {
await this.page.goto(this.baseUrl);
await this.page.reload({ waitUntil: 'networkidle' });

const input = await this.page.waitForSelector('div.flexible-query-input textarea');
await input.fill(query);
await clickButton(this.page, 'Run');
await this.page.waitForSelector('div.result-table-pane', { timeout: 120000 });

return await extractTable(this.page, 'div.result-table-pane div.rt-tr-group', 'div.rt-td');
}
}
72 changes: 72 additions & 0 deletions web-console/e2e-tests/multi-stage-query.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as playwright from 'playwright-chromium';

import { WorkbenchOverview } from './component/workbench/overview';
import { saveScreenshotIfError } from './util/debug';
import { DRUID_EXAMPLES_QUICKSTART_TUTORIAL_DIR, UNIFIED_CONSOLE_URL } from './util/druid';
import { createBrowser, createPage } from './util/playwright';
import { waitTillWebConsoleReady } from './util/setup';

jest.setTimeout(5 * 60 * 1000);

describe('Multi-stage query', () => {
let browser: playwright.Browser;
let page: playwright.Page;

beforeAll(async () => {
await waitTillWebConsoleReady();
browser = await createBrowser();
});

beforeEach(async () => {
page = await createPage(browser);
});

afterAll(async () => {
await browser.close();
});

it('runs a query that reads external data', async () => {
await saveScreenshotIfError('multi-stage-query', page, async () => {
const workbench = new WorkbenchOverview(page, UNIFIED_CONSOLE_URL);
const results = await workbench.runQuery(`WITH ext AS (SELECT *
FROM TABLE(
EXTERN(
'{"type":"local","filter":"wikiticker-2015-09-12-sampled.json.gz","baseDir":${JSON.stringify(
DRUID_EXAMPLES_QUICKSTART_TUTORIAL_DIR,
)}}',
'{"type":"json"}',
'[{"name":"channel","type":"string"}]'
)
))
SELECT
channel,
CAST(COUNT(*) AS VARCHAR) AS "CountString"
FROM ext
GROUP BY 1
ORDER BY COUNT(*) DESC
LIMIT 10`);
expect(results).toBeDefined();
expect(results.length).toBe(10);
expect(results[0]).toStrictEqual(['#en.wikipedia', '11549']);
expect(results[1]).toStrictEqual(['#vi.wikipedia', '9747']);
});
});
});
6 changes: 6 additions & 0 deletions web-console/lib/keywords.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ exports.SQL_KEYWORDS = [
'ROWS',
'ONLY',
'VALUES',
'PARTITIONED BY',
'CLUSTERED BY',
'TIME',
'INSERT INTO',
'REPLACE INTO',
'OVERWRITE',
];

exports.SQL_EXPRESSION_PARTS = [
Expand Down
2 changes: 1 addition & 1 deletion web-console/lib/sql-docs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
* limitations under the License.
*/

export const SQL_DATA_TYPES: [name: string, runtime: string, description: string][];
export const SQL_DATA_TYPES: Record<string, [runtime: string, description: string][]>;
export const SQL_FUNCTIONS: Record<string, [args: string, description: string][]>;
Loading