diff --git a/common/constants/index.ts b/common/constants/index.ts index 4fc24444..ed37754e 100644 --- a/common/constants/index.ts +++ b/common/constants/index.ts @@ -8,20 +8,20 @@ export const PLUGIN_NAME = 'Query Workbench'; export const OPENSEARCH_ACC_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest'; export const ACC_INDEX_TYPE_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest'; -export const SKIPPING_INDEX = `skipping_index` +export const SKIPPING_INDEX = `skipping_index`; export const ON_LOAD_QUERY = `SHOW tables LIKE '%';`; export const SKIPPING_INDEX_QUERY = `CREATE SKIPPING INDEX ON myS3.logs_db.http_logs (status VALUE_SET) WITH ( auto_refresh = true - )` -export const COVERING_INDEX_QUERY =`CREATE INDEX covering_idx ON myS3.logs_db.http_logs + )`; +export const COVERING_INDEX_QUERY = `CREATE INDEX covering_idx ON myS3.logs_db.http_logs (status) WITH ( auto_refresh = true - )` -export const CREATE_DATABASE_QUERY =`CREATE DATABASE myS3.logs_db` -export const CREATE_TABLE_QUERY =`CREATE EXTERNAL TABLE logs ( + )`; +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, @@ -32,7 +32,7 @@ USING JSON OPTIONS ( path 's3://test/path', compression 'gzip' -);` +);`; export const ACCELERATION_INDEX_TYPES = [ { label: 'Skipping Index', value: 'skipping' }, @@ -80,3 +80,5 @@ export const ACCELERATION_INDEX_NAME_INFO = `All OpenSearch acceleration indices ##### Note: - All user given index names must be in lowercase letters. Cannot begin with underscores or hyphens. Spaces, commas, and characters :, ", *, +, /, \, |, ?, #, >, or < are not allowed. `; + +export const SIDEBAR_POLL_INTERVAL_MS = 5000; diff --git a/public/components/Main/__snapshots__/main.test.tsx.snap b/public/components/Main/__snapshots__/main.test.tsx.snap index ff0dd051..d8ef37d5 100644 --- a/public/components/Main/__snapshots__/main.test.tsx.snap +++ b/public/components/Main/__snapshots__/main.test.tsx.snap @@ -193,6 +193,7 @@ exports[`
spec click clear button 1`] = ` >
spec click run button, and response causes an error 1`] = ` >
spec click run button, and response is not ok 1`] = ` >
spec click run button, and response is ok 1`] = ` >
spec click run button, and response is ok 1`] = ` class="euiTreeView__nodeLabel" >
- 2 + +
+ 2 +
+
@@ -2015,7 +2027,15 @@ exports[`
spec click run button, and response is ok 1`] = ` class="euiTreeView__nodeLabel" >
- 2 + +
+ 2 +
+
@@ -2501,6 +2521,7 @@ exports[`
spec click run button, response fills null and missing values >
spec click run button, response fills null and missing values class="euiTreeView__nodeLabel" >
+ +
+
@@ -2645,6 +2673,13 @@ exports[`
spec click run button, response fills null and missing values class="euiTreeView__nodeLabel" >
+ +
+
@@ -3133,6 +3168,7 @@ exports[`
spec click translation button, and response is ok 1`] = ` >
spec renders the component 1`] = ` >
spec renders the component 1`] = ` class="euiTreeView__nodeLabel" >
- .kibana_1 + +
+ .kibana_1 +
+
diff --git a/public/components/Main/main.tsx b/public/components/Main/main.tsx index 046554dc..a8b38326 100644 --- a/public/components/Main/main.tsx +++ b/public/components/Main/main.tsx @@ -14,7 +14,7 @@ import { EuiPageSideBar, EuiPanel, EuiSpacer, - EuiText + EuiText, } from '@elastic/eui'; import { IHttpResponse } from 'angular'; import _ from 'lodash'; @@ -790,6 +790,9 @@ export class Main extends React.Component { } handleDataSelect = (selectedItems: []) => { + if (selectedItems[0].label !== 'OpenSearch' && this.state.language === 'SQL') { + this.updateSQLQueries(''); + } this.setState({ selectedDatasource: selectedItems, }); @@ -912,13 +915,11 @@ export class Main extends React.Component { {this.state.language === 'SQL' && ( - + - + void; @@ -107,7 +106,7 @@ export class PPLPage extends React.Component { spec renders the component 1`] = `