Skip to content

Commit

Permalink
Revert "UI-bug fixes, added create query for MV (opensearch-project#182
Browse files Browse the repository at this point in the history
…) (opensearch-project#188)"

This reverts commit 4187b6d.

Signed-off-by: Eric <menwe@amazon.com>
  • Loading branch information
mengweieric committed Nov 8, 2023
1 parent dd4f2cd commit 40091f0
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 286 deletions.
25 changes: 6 additions & 19 deletions common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ export const TREE_ITEM_TABLE_NAME_DEFAULT_NAME = `table`;
export const TREE_ITEM_LOAD_MATERIALIZED_BADGE_NAME = `Load Materialized View`;
export const TREE_ITEM_BADGE_NAME = `badge`;
export const LOAD_OPENSEARCH_INDICES_QUERY = `SHOW tables LIKE '%';`;
export const SKIPPING_INDEX_QUERY = `CREATE SKIPPING INDEX ON datasource.database.table
export const SKIPPING_INDEX_QUERY = `CREATE SKIPPING INDEX ON myS3.logs_db.http_logs
(status VALUE_SET)
WITH (
auto_refresh = true,
checkpoint_location = 's3://test/'
auto_refresh = true
)`;
export const COVERING_INDEX_QUERY = `CREATE INDEX covering_idx ON datasource.database.table
export const COVERING_INDEX_QUERY = `CREATE INDEX covering_idx ON myS3.logs_db.http_logs
(status)
WITH (
auto_refresh = true,
checkpoint_location = 's3://test/'
auto_refresh = true
)`;
export const CREATE_DATABASE_QUERY = `CREATE DATABASE datasource.database`;
export const CREATE_TABLE_QUERY = `CREATE EXTERNAL TABLE datasource.database.table (
export const CREATE_DATABASE_QUERY = `CREATE DATABASE myS3.logs_db`;
export const CREATE_TABLE_QUERY = `CREATE EXTERNAL TABLE myS3.logs_db.logs (
key BIGINT,
status INTEGER,
size FLOAT,
Expand All @@ -44,17 +42,6 @@ OPTIONS (
compression 'gzip'
);`;

export const CREATE_MATERIALIZED_VIEW = `CREATE MATERIALIZED VIEW datasource.database.materialized_view
AS SELECT
count(field)
FROM datasource.database.table
GROUP BY TUMBLE (timestamp, '2 hours')
WITH (
auto_refresh = true,
watermark_delay = '2 minutes',
checkpoint_location = 's3://test/'
)`;

export const ACCELERATION_INDEX_TYPES = [
{ label: 'Skipping Index', value: 'skipping' },
{ label: 'Covering Index', value: 'covering' },
Expand Down
3 changes: 0 additions & 3 deletions common/utils/async_query_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export const getJobId = (query: {}, http: CoreStart['http'], callback) => {
.then((res) => {
const id = res.data.resp.queryId;
setAsyncSessionId(_.get(res.data.resp, 'sessionId', null));
if (id === undefined) {
console.error(JSON.parse(res.data.body));
}
callback(id);
})
.catch((err) => {
Expand Down
19 changes: 1 addition & 18 deletions public/components/SQLPage/CreateButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import React, { useState } from 'react';
import {
COVERING_INDEX_QUERY,
CREATE_DATABASE_QUERY,
CREATE_MATERIALIZED_VIEW,
CREATE_TABLE_QUERY,
SKIPPING_INDEX_QUERY
SKIPPING_INDEX_QUERY,
} from '../../../common/constants';

interface CreateButtonProps {
Expand Down Expand Up @@ -58,13 +57,6 @@ export const CreateButton = ({ updateSQLQueries, selectedDatasource }: CreateBut
},
];

const materializedViewItems = [
{
name: 'Materialized View',
onClick: () => handleSubMenuClick(CREATE_MATERIALIZED_VIEW),
},
];

const button = (
<EuiButton iconType="arrowDown" iconSide="right" onClick={() => togglePopover(null)}>
Create
Expand Down Expand Up @@ -96,10 +88,6 @@ export const CreateButton = ({ updateSQLQueries, selectedDatasource }: CreateBut
name: 'Acceleration Index',
panel: 2,
},
{
name: 'Materialized View',
panel: 3,
}
],
},
{
Expand All @@ -112,11 +100,6 @@ export const CreateButton = ({ updateSQLQueries, selectedDatasource }: CreateBut
title: 'Acceleration Index Options',
items: acceleratedIndexItems,
},
{
id: 3,
title: 'Create Materialized View',
items: materializedViewItems,
},
]}
/>
</EuiPopover>
Expand Down
Loading

0 comments on commit 40091f0

Please sign in to comment.