From 6134d4ae2c6a00d9eb64011affaae0f5186e0fe3 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Mon, 26 Feb 2024 18:31:21 +0530 Subject: [PATCH] ui: make overwrite only option --- ui/app/mirrors/create/helpers/common.ts | 10 ++++++++-- ui/app/mirrors/create/helpers/qrep.ts | 4 +--- ui/app/mirrors/create/qrep/snowflakeQrep.tsx | 12 +++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/app/mirrors/create/helpers/common.ts b/ui/app/mirrors/create/helpers/common.ts index 856217509e..cc005cfc34 100644 --- a/ui/app/mirrors/create/helpers/common.ts +++ b/ui/app/mirrors/create/helpers/common.ts @@ -1,4 +1,8 @@ -import { FlowConnectionConfigs, QRepWriteType } from '@/grpc_generated/flow'; +import { + FlowConnectionConfigs, + QRepWriteMode, + QRepWriteType, +} from '@/grpc_generated/flow'; import { Peer } from '@/grpc_generated/peers'; export interface MirrorSetting { @@ -62,7 +66,9 @@ export const blankSnowflakeQRepSetting = { watermarkColumn: '', maxParallelWorkers: 4, waitBetweenBatchesSeconds: 30, - writeMode: undefined, + writeMode: { + writeType: QRepWriteType.QREP_WRITE_MODE_OVERWRITE, + } as QRepWriteMode, stagingPath: '', numRowsPerPartition: 100000, setupWatermarkTableOnDestination: false, diff --git a/ui/app/mirrors/create/helpers/qrep.ts b/ui/app/mirrors/create/helpers/qrep.ts index e18c795bc3..4fc193cd72 100644 --- a/ui/app/mirrors/create/helpers/qrep.ts +++ b/ui/app/mirrors/create/helpers/qrep.ts @@ -182,9 +182,7 @@ export const snowflakeQRepSettings: MirrorSetting[] = [ writeMode: currWriteMode, }; }), - tips: `Specify whether you want the write mode to be via APPEND, UPSERT or OVERWRITE. - Append mode is for insert-only workloads. Upsert mode is append mode but also supports updates. - Overwrite mode overwrites the destination table data every sync.`, + tips: `Overwrite mode overwrites the destination table data every sync.`, type: 'select', }, ]; diff --git a/ui/app/mirrors/create/qrep/snowflakeQrep.tsx b/ui/app/mirrors/create/qrep/snowflakeQrep.tsx index 93f7663b77..4137f86019 100644 --- a/ui/app/mirrors/create/qrep/snowflakeQrep.tsx +++ b/ui/app/mirrors/create/qrep/snowflakeQrep.tsx @@ -23,7 +23,7 @@ export default function SnowflakeQRepForm({ mirrorConfig, setter, }: SnowflakeQRepProps) { - const WriteModes = ['Append', 'Overwrite'].map((value) => ({ + const WriteModes = ['Overwrite'].map((value) => ({ label: value, value, })); @@ -65,8 +65,8 @@ export default function SnowflakeQRepForm({ <>
- val && handleChange(val.value, setting) - } - options={WriteModes} + value={{ value: 'Overwrite', label: 'Overwrite' }} />