From 0961ccd3eb106d90d99c054a45ff318b3f5a444f Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Tue, 3 Oct 2023 14:26:14 -0700 Subject: [PATCH] remove [if not exists] from acc creation Signed-off-by: Shenoy Pratik --- .../query_visual_editor.test.tsx.snap | 28 ------------------- .../covering_index_builder.test.tsx.snap | 28 ------------------- .../covering_index/covering_index_builder.tsx | 3 -- .../materialized_view_builder.test.tsx.snap | 28 ------------------- .../materialized_view_builder.tsx | 4 --- .../visual_editors/query_builder.tsx | 8 +----- test/mocks/accelerationMock.ts | 10 ++----- 7 files changed, 3 insertions(+), 106 deletions(-) diff --git a/public/components/acceleration/visual_editors/__tests__/__snapshots__/query_visual_editor.test.tsx.snap b/public/components/acceleration/visual_editors/__tests__/__snapshots__/query_visual_editor.test.tsx.snap index 8659a435..3a281f7a 100644 --- a/public/components/acceleration/visual_editors/__tests__/__snapshots__/query_visual_editor.test.tsx.snap +++ b/public/components/acceleration/visual_editors/__tests__/__snapshots__/query_visual_editor.test.tsx.snap @@ -39,20 +39,6 @@ Array [ -
- - - [IF NOT EXISTS] - - - -
@@ -354,20 +340,6 @@ Array [ ..skipping , -
- - - [IF NOT EXISTS] - - - -
,
diff --git a/public/components/acceleration/visual_editors/covering_index/__tests__/__snapshots__/covering_index_builder.test.tsx.snap b/public/components/acceleration/visual_editors/covering_index/__tests__/__snapshots__/covering_index_builder.test.tsx.snap index 3d237119..24d90273 100644 --- a/public/components/acceleration/visual_editors/covering_index/__tests__/__snapshots__/covering_index_builder.test.tsx.snap +++ b/public/components/acceleration/visual_editors/covering_index/__tests__/__snapshots__/covering_index_builder.test.tsx.snap @@ -35,20 +35,6 @@ Array [
-
- - - [IF NOT EXISTS] - - - -
@@ -130,20 +116,6 @@ Array [
-
- - - [IF NOT EXISTS] - - - -
diff --git a/public/components/acceleration/visual_editors/covering_index/covering_index_builder.tsx b/public/components/acceleration/visual_editors/covering_index/covering_index_builder.tsx index 5968ca01..8d3c6019 100644 --- a/public/components/acceleration/visual_editors/covering_index/covering_index_builder.tsx +++ b/public/components/acceleration/visual_editors/covering_index/covering_index_builder.tsx @@ -58,9 +58,6 @@ export const CoveringIndexBuilder = ({ value={accelerationFormData.accelerationIndexName} /> - - - , -
- - - [IF NOT EXISTS] - - - -
,
@@ -184,20 +170,6 @@ Array [ ..skipping , -
- - - [IF NOT EXISTS] - - - -
,
diff --git a/public/components/acceleration/visual_editors/materialized_view/materialized_view_builder.tsx b/public/components/acceleration/visual_editors/materialized_view/materialized_view_builder.tsx index 124b451c..e9ef4319 100644 --- a/public/components/acceleration/visual_editors/materialized_view/materialized_view_builder.tsx +++ b/public/components/acceleration/visual_editors/materialized_view/materialized_view_builder.tsx @@ -74,10 +74,6 @@ export const MaterializedViewBuilder = ({ value={`${accelerationFormData.dataSource}.${accelerationFormData.database}.${accelerationFormData.accelerationIndexName}`} /> - - - - { const { dataSource, database, dataTable, skippingIndexQueryData } = accelerationformData; - const codeQuery = `CREATE SKIPPING INDEX -[IF NOT EXISTS] + const codeQuery = `CREATE SKIPPING INDEX ON ${dataSource}.${database}.${dataTable} FOR COLUMNS ( ${buildSkippingIndexColumns(skippingIndexQueryData)} @@ -94,7 +92,6 @@ const buildCoveringIndexColumns = (coveringIndexQueryData: string[]) => { * Covering Index create query example: * * CREATE INDEX index_name - * [IF NOT EXISTS] * ON datasource.database.table * FOR COLUMNS ( * field1, @@ -117,7 +114,6 @@ export const coveringIndexQueryBuilder = (accelerationformData: CreateAccelerati } = accelerationformData; const codeQuery = `CREATE INDEX ${accelerationIndexName} -[IF NOT EXISTS] ON ${dataSource}.${database}.${dataTable} FOR COLUMNS ( ${buildCoveringIndexColumns(coveringIndexQueryData)} @@ -148,7 +144,6 @@ const buildTumbleValue = (GroupByTumbleValue: GroupByTumbleType) => { * Materialized View create query example: * * CREATE MATERIALIZED VIEW datasource.database.index_name - * [IF NOT EXISTS] * AS SELECT * count(field) as counter, * count(*) as counter1, @@ -171,7 +166,6 @@ export const materializedQueryViewBuilder = (accelerationformData: CreateAcceler } = accelerationformData; const codeQuery = `CREATE MATERIALIZED VIEW ${dataSource}.${database}.${accelerationIndexName} -[IF NOT EXISTS] AS SELECT ${buildMaterializedViewColumns(materializedViewQueryData.columnsValues)} FROM ${dataSource}.${database}.${dataTable} diff --git a/test/mocks/accelerationMock.ts b/test/mocks/accelerationMock.ts index 154dbd22..085459de 100644 --- a/test/mocks/accelerationMock.ts +++ b/test/mocks/accelerationMock.ts @@ -201,8 +201,7 @@ export const skippingIndexBuilderMock1: CreateAccelerationForm = { checkpointLocation: 's3://test/', }; -export const skippingIndexBuilderMockResult1 = `CREATE SKIPPING INDEX -[IF NOT EXISTS] +export const skippingIndexBuilderMockResult1 = `CREATE SKIPPING INDEX ON datasource.database.table FOR COLUMNS ( field1 PARTITION, @@ -234,8 +233,7 @@ export const skippingIndexBuilderMock2: CreateAccelerationForm = { checkpointLocation: 's3://test/', }; -export const skippingIndexBuilderMockResult2 = `CREATE SKIPPING INDEX -[IF NOT EXISTS] +export const skippingIndexBuilderMockResult2 = `CREATE SKIPPING INDEX ON datasource.database.table FOR COLUMNS ( field1 PARTITION @@ -263,7 +261,6 @@ export const coveringIndexBuilderMock1: CreateAccelerationForm = { }; export const coveringIndexBuilderMockResult1 = `CREATE INDEX index_name -[IF NOT EXISTS] ON datasource.database.table FOR COLUMNS ( field1, @@ -290,7 +287,6 @@ export const coveringIndexBuilderMock2: CreateAccelerationForm = { }; export const coveringIndexBuilderMockResult2 = `CREATE INDEX index_name -[IF NOT EXISTS] ON datasource.database.table FOR COLUMNS ( field1 @@ -330,7 +326,6 @@ export const materializedViewBuilderMock1: CreateAccelerationForm = { }; export const materializedViewBuilderMockResult1 = `CREATE MATERIALIZED VIEW datasource.database.index_name -[IF NOT EXISTS] AS SELECT count(field) AS counter, count(*) AS counter1, @@ -366,7 +361,6 @@ export const materializedViewBuilderMock2: CreateAccelerationForm = { }; export const materializedViewBuilderMockResult2 = `CREATE MATERIALIZED VIEW datasource.database.index_name -[IF NOT EXISTS] AS SELECT count(field) FROM datasource.database.table