diff --git a/common/constants/index.ts b/common/constants/index.ts index 0f78c810..6e88cb94 100644 --- a/common/constants/index.ts +++ b/common/constants/index.ts @@ -89,6 +89,7 @@ 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 17208cc3..ad06694d 100644 --- a/common/types/index.ts +++ b/common/types/index.ts @@ -32,6 +32,11 @@ export interface RefreshIntervalType { refreshInterval: string; } +export interface watermarkDelayType { + delayWindow: number; + delayInterval: string; +} + export type AccelerationIndexType = 'skipping' | 'covering' | 'materialized'; export interface GroupByTumbleType { @@ -57,6 +62,7 @@ export interface FormErrorsType { replicaShardsError: string[]; refreshIntervalError: string[]; checkpointLocationError: string[]; + watermarkDelayError: string[]; } export type AccelerationRefreshType = 'auto' | 'interval' | 'manual'; @@ -75,22 +81,30 @@ 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 isLoading { +export interface DatasourceTreeLoading { flag: boolean; status: string; } diff --git a/common/utils/async_query_helpers.ts b/common/utils/async_query_helpers.ts index 3731859e..ca20fd79 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 3b7c236c..5627180f 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/index/'; + link = 'https://opensearch.org/docs/latest/search-plugins/sql/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/observability-plugin/ppl/index/'; + link = 'https://opensearch.org/docs/latest/search-plugins/sql/ppl/index/'; linkTitle = 'PPL documentation'; } @@ -957,18 +957,26 @@ 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 e2448b69..416c1025 100644 --- a/public/components/SQLPage/DataSelect.tsx +++ b/public/components/SQLPage/DataSelect.tsx @@ -74,8 +74,10 @@ export const DataSelect = ({ http, onSelect, urlDataSource, asyncLoading }: Cust }, []); const handleSelectionChange = (selectedItems: any[]) => { - setSelectedOptions(selectedItems); - onSelect(selectedItems); + if (selectedItems.length > 0) { + 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 new file mode 100644 index 00000000..5f635691 --- /dev/null +++ b/public/components/SQLPage/__tests__/__snapshots__/acceleration_index_flyout.test.tsx.snap @@ -0,0 +1,1824 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Acceleration index flyout renders acceleration flyout with covering index 1`] = ` +Array [ + "", + +