Skip to content

Commit

Permalink
Merge branch 'main' into ui/peerdb-columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj authored Apr 30, 2024
2 parents 88d5388 + 13921fb commit 8a1d66b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions flow/connectors/clickhouse/qrep_avro_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func (s *ClickhouseAvroSyncMethod) SyncQRepRecords(
for _, col := range dstTableSchema {
colName := col.Name()
if strings.EqualFold(colName, config.SoftDeleteColName) ||
strings.EqualFold(colName, signColName) ||
strings.EqualFold(colName, config.SyncedAtColName) ||
strings.EqualFold(colName, versionColName) {
continue
Expand Down
11 changes: 11 additions & 0 deletions ui/app/mirrors/create/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ export const handleCreateQRep = async (
return;
}

if (
!xmin &&
config.writeMode?.writeType != QRepWriteType.QREP_WRITE_MODE_OVERWRITE &&
!(query.includes('{{.start}}') && query.includes('{{.end}}'))
) {
notifyErr(
'Please include placeholders {{.start}} and {{.end}} in the query'
);
return;
}

if (xmin == true) {
config.watermarkColumn = 'xmin';
config.query = `SELECT * FROM ${quotedWatermarkTable(
Expand Down
5 changes: 5 additions & 0 deletions ui/app/mirrors/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ export default function CreateMirrors() {
Write a query whose results will be replicated to a target
table.
<br></br>
For append and upsert modes, make sure the query{' '}
<b>includes the start and end placeholders</b> in the query.
PeerDB uses these placeholders for partitioning query results
for performance.
<br></br>
In most cases, you will require a watermark table and a
watermark column in that table.
<br></br>
Expand Down

0 comments on commit 8a1d66b

Please sign in to comment.