From 91e00410f894e1a73710eb165102b657e0257868 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 8 Nov 2023 21:14:14 +0000 Subject: [PATCH] Revert "Make checkpoint mandatory, add watermark delay, minor UI fixes (#173) (#175)" This reverts commit 0198fa7fc20ff5dee7caf75b5fef6ba6818f4508. Signed-off-by: Eric --- common/constants/index.ts | 1 - common/types/index.ts | 20 +- common/utils/async_query_helpers.ts | 2 +- .../Main/__snapshots__/main.test.tsx.snap | 28 +- public/components/Main/main.tsx | 24 +- public/components/SQLPage/DataSelect.tsx | 6 +- .../acceleration_index_flyout.test.tsx.snap | 1824 ----------------- .../acceleration_index_flyout.test.tsx | 109 - .../SQLPage/acceleration_index_flyout.tsx | 81 +- public/components/SQLPage/table_view.test.tsx | 5 + public/components/SQLPage/table_view.tsx | 47 +- .../create_acceleration.test.tsx.snap | 4 +- .../create/__tests__/utils.test.tsx | 29 +- .../create/create_acceleration.tsx | 5 - .../components/acceleration/create/utils.tsx | 22 +- .../index_setting_options.test.tsx.snap | 6 +- .../selectors/index_setting_options.tsx | 65 +- .../selectors/index_type_selector.tsx | 31 +- .../selectors/source_selector.tsx | 85 +- .../__tests__/query_builder.test.tsx | 7 - .../group_by_tumble_expression.tsx | 4 +- .../visual_editors/query_builder.tsx | 11 +- test/mocks/accelerationMock.ts | 35 - 23 files changed, 159 insertions(+), 2292 deletions(-) delete mode 100644 public/components/SQLPage/__tests__/__snapshots__/acceleration_index_flyout.test.tsx.snap delete mode 100644 public/components/SQLPage/__tests__/acceleration_index_flyout.test.tsx diff --git a/common/constants/index.ts b/common/constants/index.ts index 6e88cb94..0f78c810 100644 --- a/common/constants/index.ts +++ b/common/constants/index.ts @@ -89,7 +89,6 @@ export const ACCELERATION_INDEX_NAME_INFO = `All OpenSearch acceleration indices - All user given index names must be in lowercase letters. Index name cannot begin with underscores. Spaces, commas, and characters -, :, ", *, +, /, \, |, ?, #, >, or < are not allowed. `; -export const TIMESTAMP_DATATYPE = 'timestamp'; export const FETCH_OPENSEARCH_INDICES_PATH = '/api/sql_console/sqlquery'; export const POLL_INTERVAL_MS = 2000; export const ASYNC_QUERY_ENDPOINT = '/api/spark_sql_console'; diff --git a/common/types/index.ts b/common/types/index.ts index ad06694d..17208cc3 100644 --- a/common/types/index.ts +++ b/common/types/index.ts @@ -32,11 +32,6 @@ export interface RefreshIntervalType { refreshInterval: string; } -export interface watermarkDelayType { - delayWindow: number; - delayInterval: string; -} - export type AccelerationIndexType = 'skipping' | 'covering' | 'materialized'; export interface GroupByTumbleType { @@ -62,7 +57,6 @@ export interface FormErrorsType { replicaShardsError: string[]; refreshIntervalError: string[]; checkpointLocationError: string[]; - watermarkDelayError: string[]; } export type AccelerationRefreshType = 'auto' | 'interval' | 'manual'; @@ -81,30 +75,22 @@ export interface CreateAccelerationForm { replicaShardsCount: number; refreshType: AccelerationRefreshType; checkpointLocation: string | undefined; - watermarkDelay: watermarkDelayType; refreshIntervalOptions: RefreshIntervalType; formErrors: FormErrorsType; } export type AsyncQueryLoadingStatus = 'SUCCESS' | 'FAILED' | 'RUNNING' | 'SCHEDULED' | 'CANCELLED'; -export type TreeItemType = - | 'covering_index' - | 'skipping_index' - | 'table' - | 'database' - | 'materialized_view' - | 'Load Materialized View' - | 'badge'; +export type TreeItemType = 'covering_index' | 'skipping_index' | 'table' | 'database' | 'materialized_view' | 'Load Materialized View' | 'badge' export interface TreeItem { name: string; type: TreeItemType; isExpanded: boolean; values?: TreeItem[]; - isLoading?: boolean; + isLoading?: boolean } -export interface DatasourceTreeLoading { +export interface isLoading { flag: boolean; status: string; } diff --git a/common/utils/async_query_helpers.ts b/common/utils/async_query_helpers.ts index ca20fd79..3731859e 100644 --- a/common/utils/async_query_helpers.ts +++ b/common/utils/async_query_helpers.ts @@ -47,7 +47,7 @@ export const pollQueryStatus = (id: string, http: CoreStart['http'], callback) = status === 'scheduled' || status === 'waiting' ) { - callback({ status: status }); + callback({status: status}) setTimeout(() => pollQueryStatus(id, http, callback), POLL_INTERVAL_MS); } else if (status === 'failed') { callback({ status: 'FAILED', results: [] }); diff --git a/public/components/Main/__snapshots__/main.test.tsx.snap b/public/components/Main/__snapshots__/main.test.tsx.snap index 5627180f..3b7c236c 100644 --- a/public/components/Main/__snapshots__/main.test.tsx.snap +++ b/public/components/Main/__snapshots__/main.test.tsx.snap @@ -155,7 +155,7 @@ exports[`
spec click clear button 1`] = ` > @@ -193,7 +193,7 @@ exports[`
spec click clear button 1`] = ` >
spec click run button, and response causes an error 1`] = ` > @@ -750,7 +750,7 @@ exports[`
spec click run button, and response causes an error 1`] = ` >
spec click run button, and response is not ok 1`] = ` > @@ -1307,7 +1307,7 @@ exports[`
spec click run button, and response is not ok 1`] = ` >
spec click run button, and response is ok 1`] = ` > @@ -1864,7 +1864,7 @@ exports[`
spec click run button, and response is ok 1`] = ` >
spec click run button, response fills null and missing values > @@ -2505,7 +2505,7 @@ exports[`
spec click run button, response fills null and missing values >
spec click translation button, and response is ok 1`] = ` > @@ -3145,7 +3145,7 @@ exports[`
spec click translation button, and response is ok 1`] = ` >
spec renders the component 1`] = ` > @@ -3693,7 +3693,7 @@ exports[`
spec renders the component 1`] = ` >
{ refreshTree: !this.state.refreshTree, }); }; - + setIsAccelerationFlyoutOpened = (value: boolean) => { this.setState({ isAccelerationFlyoutOpened: value, @@ -863,7 +863,7 @@ export class Main extends React.Component { setIsAccelerationFlyoutOpened={this.setIsAccelerationFlyoutOpened} /> ); - link = 'https://opensearch.org/docs/latest/search-plugins/sql/sql/index/'; + link = 'https://opensearch.org/docs/latest/search-plugins/sql/index/'; linkTitle = 'SQL documentation'; } else { page = ( @@ -881,7 +881,7 @@ export class Main extends React.Component { asyncLoading={this.state.asyncLoading} /> ); - link = 'https://opensearch.org/docs/latest/search-plugins/sql/ppl/index/'; + link = 'https://opensearch.org/docs/latest/observability-plugin/ppl/index/'; linkTitle = 'PPL documentation'; } @@ -957,26 +957,18 @@ export class Main extends React.Component { {this.state.language === 'SQL' && ( - - + + - + diff --git a/public/components/SQLPage/DataSelect.tsx b/public/components/SQLPage/DataSelect.tsx index 416c1025..e2448b69 100644 --- a/public/components/SQLPage/DataSelect.tsx +++ b/public/components/SQLPage/DataSelect.tsx @@ -74,10 +74,8 @@ export const DataSelect = ({ http, onSelect, urlDataSource, asyncLoading }: Cust }, []); const handleSelectionChange = (selectedItems: any[]) => { - if (selectedItems.length > 0) { - setSelectedOptions(selectedItems); - onSelect(selectedItems); - } + setSelectedOptions(selectedItems); + onSelect(selectedItems); }; return ( diff --git a/public/components/SQLPage/__tests__/__snapshots__/acceleration_index_flyout.test.tsx.snap b/public/components/SQLPage/__tests__/__snapshots__/acceleration_index_flyout.test.tsx.snap deleted file mode 100644 index 5f635691..00000000 --- a/public/components/SQLPage/__tests__/__snapshots__/acceleration_index_flyout.test.tsx.snap +++ /dev/null @@ -1,1824 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Acceleration index flyout renders acceleration flyout with covering index 1`] = ` -Array [ - "", - -