Skip to content

Commit

Permalink
remove [if not exists] from acc creation
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 committed Oct 3, 2023
1 parent c5c78cd commit 0961ccd
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,6 @@ Array [
</span>
</span>
</div>
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>
<div
className="euiFlexItem"
>
Expand Down Expand Up @@ -354,20 +340,6 @@ Array [
..skipping
</span>
</span>,
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>,
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ Array [
</span>
</span>
</div>
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>
<div
className="euiFlexItem"
>
Expand Down Expand Up @@ -130,20 +116,6 @@ Array [
</span>
</span>
</div>
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>
<div
className="euiFlexItem"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export const CoveringIndexBuilder = ({
value={accelerationFormData.accelerationIndexName}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiExpression description="[IF NOT EXISTS]" />
</EuiFlexItem>
<EuiFlexItem>
<EuiExpression
description="ON"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ Array [
..skipping
</span>
</span>,
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>,
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
Expand Down Expand Up @@ -184,20 +170,6 @@ Array [
..skipping
</span>
</span>,
<div
className="euiFlexItem euiFlexItem--flexGrowZero"
>
<span
className="euiExpression euiExpression-isUppercase euiExpression--success"
>
<span
className="euiExpression__description"
>
[IF NOT EXISTS]
</span>
</span>
</div>,
<div
className="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ export const MaterializedViewBuilder = ({
value={`${accelerationFormData.dataSource}.${accelerationFormData.database}.${accelerationFormData.accelerationIndexName}`}
/>

<EuiFlexItem grow={false}>
<EuiExpression description="[IF NOT EXISTS]" value="" />
</EuiFlexItem>

<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiExpression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const buildSkippingIndexColumns = (skippingIndexQueryData: SkippingIndexRowType[
* Skipping Index create query example:
*
* CREATE SKIPPING INDEX
* [IF NOT EXISTS]
* ON datasource.database.table
* FOR COLUMNS (
* field1 VALUE_SET,
Expand All @@ -74,8 +73,7 @@ const buildSkippingIndexColumns = (skippingIndexQueryData: SkippingIndexRowType[
export const skippingIndexQueryBuilder = (accelerationformData: CreateAccelerationForm) => {
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)}
Expand All @@ -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,
Expand All @@ -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)}
Expand Down Expand Up @@ -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,
Expand All @@ -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}
Expand Down
10 changes: 2 additions & 8 deletions test/mocks/accelerationMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0961ccd

Please sign in to comment.