Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update form validations and tests for acceleration #133

Merged
merged 8 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ export const ACCELERATION_TIME_INTERVAL = [
{ text: 'week(s)', value: 'week' },
];

export const SKIPPING_INDEX_ACCELERATION_METHODS = [
{ value: 'PARTITION', text: 'Partition' },
{ value: 'VALUE_SET', text: 'Value Set' },
{ value: 'MIN_MAX', text: 'Min Max' },
];

export const ACCELERATION_ADD_FIELDS_TEXT = '(add fields here)';
export const ACCELERATION_INDEX_NAME_REGEX = /^[a-z][a-z_\-]*$/;
export const ACCELERATION_S3_URL_REGEX = /^(s3|s3a):\/\/[a-zA-Z0-9.\-]+\/.*/;
export const ACCELERATION_DEFUALT_SKIPPING_INDEX_NAME = 'skipping';

export const ACCELERATION_INDEX_NAME_INFO = `All OpenSearch acceleration indices have a naming format of pattern: \`prefix_<index name>_suffix\`. They share a common prefix structure, which is \`flint_<data source name>_<database name>_<table name>_\`. Additionally, they may have a suffix that varies based on the index type.
##### Skipping Index
Expand Down
21 changes: 19 additions & 2 deletions common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ export interface MaterializedViewColumn {
fieldAlias?: string;
}

export type SkippingIndexAccMethodType = 'PARTITION' | 'VALUE_SET' | 'MIN_MAX';

export interface SkippingIndexRowType {
id: string;
fieldName: string;
dataType: string;
accelerationMethod: 'PARTITION' | 'VALUE_SET' | 'MIN_MAX';
accelerationMethod: SkippingIndexAccMethodType;
}

export interface DataTableFieldsType {
Expand All @@ -43,6 +45,20 @@ export interface materializedViewQueryType {
groupByTumbleValue: GroupByTumbleType;
}

export interface FormErrorsType {
dataSourceError: string[];
databaseError: string[];
dataTableError: string[];
skippingIndexError: string[];
coveringIndexError: string[];
materializedViewError: string[];
indexNameError: string[];
primaryShardsError: string[];
replicaShardsError: string[];
refreshIntervalError: string[];
checkpointLocationError: string[];
}

export interface CreateAccelerationForm {
dataSource: string;
database: string;
Expand All @@ -57,5 +73,6 @@ export interface CreateAccelerationForm {
replicaShardsCount: number;
refreshType: 'interval' | 'auto';
checkpointLocation: string | undefined;
refreshIntervalOptions: RefreshIntervalType | undefined;
refreshIntervalOptions: RefreshIntervalType;
formErrors: FormErrorsType;
}
Loading
Loading