Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove query box, truncate step #1446

Merged
merged 4 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flow/connectors/postgres/qrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ func (c *PostgresConnector) SetupQRepMetadataTables(ctx context.Context, config
c.logger.Info("Setup metadata table.")

if config.WriteMode != nil &&
config.WriteMode.WriteType == protos.QRepWriteType_QREP_WRITE_MODE_OVERWRITE {
config.WriteMode.WriteType == protos.QRepWriteType_QREP_WRITE_MODE_OVERWRITE &&
config.SourcePeer.Type != protos.DBType_SNOWFLAKE {
_, err = c.conn.Exec(ctx,
"TRUNCATE TABLE "+config.DestinationTableIdentifier)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions ui/app/mirrors/create/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const handleCreateQRep = async (
}

if (config.sourcePeer?.snowflakeConfig) {
config.query = 'SELECT * FROM ' + config.watermarkTable;
if (config.watermarkTable == '') {
notify('Please fill in the source table');
return;
Expand Down
2 changes: 1 addition & 1 deletion ui/app/mirrors/create/helpers/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ export const blankSnowflakeQRepSetting = {
} as QRepWriteMode,
stagingPath: '',
numRowsPerPartition: 100000,
setupWatermarkTableOnDestination: false,
setupWatermarkTableOnDestination: true,
initialCopyOnly: true,
};
2 changes: 1 addition & 1 deletion ui/app/mirrors/create/helpers/qrep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const qrepSettings: MirrorSetting[] = [
stateHandler: (value, setter) =>
setter((curr: QRepConfig) => ({
...curr,
setupWatermarkTableOnDestination: (value as boolean) || false,
setupWatermarkTableOnDestination: (value as boolean) || true,
})),
tips: 'Specify if you want to create the watermark table on the destination as-is, can be used for some queries.',
type: 'switch',
Expand Down
11 changes: 0 additions & 11 deletions ui/app/mirrors/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,6 @@ export default function CreateMirrors() {
.then((res) => {
setPeers(res);
});

if (mirrorType === 'Query Replication' || mirrorType === 'XMIN') {
if (mirrorType === 'XMIN') {
setConfig((curr) => {
return { ...curr, setupWatermarkTableOnDestination: true };
});
} else
setConfig((curr) => {
return { ...curr, setupWatermarkTableOnDestination: false };
});
}
}, [mirrorType]);

let listMirrorsPage = () => {
Expand Down
15 changes: 0 additions & 15 deletions ui/app/mirrors/create/qrep/snowflakeQrep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { MirrorSetter } from '../../types';
import { fetchAllTables } from '../handlers';
import { MirrorSetting, blankSnowflakeQRepSetting } from '../helpers/common';
import { snowflakeQRepSettings } from '../helpers/qrep';
import QRepQuery from './query';

interface SnowflakeQRepProps {
mirrorConfig: QRepConfig;
Expand Down Expand Up @@ -82,20 +81,6 @@ export default function SnowflakeQRepForm({
}, [setter]);
return (
<>
<Label>
Snowflake to PostgreSQL Query Replication currently only supports
full-table streaming replication with overwrite mode. More features
coming soon!
</Label>
<QRepQuery
query={mirrorConfig.query}
setter={(val: string) => {
setter((curr) => ({
...curr,
query: val,
}));
}}
/>
{mirrorConfig.sourcePeer?.name ? (
snowflakeQRepSettings.map((setting, id) => {
return (
Expand Down
Loading