Skip to content

Commit

Permalink
ui: make overwrite only option
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Feb 26, 2024
1 parent c1658e4 commit 6134d4a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 8 additions & 2 deletions ui/app/mirrors/create/helpers/common.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions ui/app/mirrors/create/helpers/qrep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];
12 changes: 5 additions & 7 deletions ui/app/mirrors/create/qrep/snowflakeQrep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}));
Expand Down Expand Up @@ -65,8 +65,8 @@ export default function SnowflakeQRepForm({
<>
<Label>
Snowflake to PostgreSQL Query Replication currently only supports
append-only, full-table streaming replication. More features coming
soon!
full-table streaming replication with overwrite mode. More features
coming soon!
</Label>
<QRepQuery
query={mirrorConfig.query}
Expand Down Expand Up @@ -127,11 +127,9 @@ export default function SnowflakeQRepForm({
>
<div style={{ width: '100%' }}>
<ReactSelect
isDisabled={true}
placeholder='Select a write mode'
onChange={(val) =>
val && handleChange(val.value, setting)
}
options={WriteModes}
value={{ value: 'Overwrite', label: 'Overwrite' }}
/>
</div>

Expand Down

0 comments on commit 6134d4a

Please sign in to comment.