Skip to content

Commit

Permalink
update s3 regex
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 committed Oct 25, 2023
1 parent a6fac65 commit 984defc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const SKIPPING_INDEX_ACCELERATION_METHODS = [

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_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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ describe('validateCheckpointLocation', () => {
expect(validCheckpoint).toEqual([]);
});

it('should return an empty array when the checkpoint location is a valid S3A URL with just bucket in checkpoint', () => {
const validCheckpoint = validateCheckpointLocation('auto', 's3a://valid-s3-bucket');
expect(validCheckpoint).toEqual([]);
});

it('should return an empty array when using manual refresh with no checkpoint location', () => {
const validMaterializedCheckpoint = validateCheckpointLocation('manual', '');
expect(validMaterializedCheckpoint).toEqual([]);
Expand Down

0 comments on commit 984defc

Please sign in to comment.