From f6614fec41412d6bac7240c0a31a4d4c5e25d183 Mon Sep 17 00:00:00 2001 From: candiduslynx Date: Fri, 24 Feb 2023 11:26:10 +0200 Subject: [PATCH] skip filter for no PK --- plugins/destination/managed_writer.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/destination/managed_writer.go b/plugins/destination/managed_writer.go index fdc088f0e6..6b6e0c631b 100644 --- a/plugins/destination/managed_writer.go +++ b/plugins/destination/managed_writer.go @@ -72,6 +72,11 @@ func (p *Plugin) flush(ctx context.Context, metrics *Metrics, table *schema.Tabl } func (p *Plugin) removeDuplicatesByPK(table *schema.Table, resources [][]any) [][]any { + // special case where there's no PK at all + if len(table.PrimaryKeys()) == 0 { + return resources + } + pks := make(map[string]struct{}, len(resources)) res := make([][]any, 0, len(resources)) var reported bool