From 53047e26353a02ad64a887caa8116ff03236f541 Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Mon, 12 Feb 2024 22:25:21 -0500 Subject: [PATCH] fix resync syntax error (#1271) --- flow/connectors/bigquery/bigquery.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flow/connectors/bigquery/bigquery.go b/flow/connectors/bigquery/bigquery.go index 5ad0642d09..d4040c0aa4 100644 --- a/flow/connectors/bigquery/bigquery.go +++ b/flow/connectors/bigquery/bigquery.go @@ -831,7 +831,8 @@ func (c *BigQueryConnector) RenameTables(ctx context.Context, req *protos.Rename } } - allCols := allColsBuilder.String() + allColsWithoutAlias := strings.Join(columnNames, ",") + allColsWithAlias := allColsBuilder.String() pkeyCols := strings.Join(renameRequest.TableSchema.PrimaryKeyColumns, ",") @@ -840,8 +841,8 @@ func (c *BigQueryConnector) RenameTables(ctx context.Context, req *protos.Rename activity.RecordHeartbeat(ctx, fmt.Sprintf("handling soft-deletes for table '%s'...", dstDatasetTable.string())) q := fmt.Sprintf("INSERT INTO %s(%s) SELECT %s,true AS %s FROM %s _pt WHERE (%s) NOT IN (SELECT %s FROM %s)", - srcDatasetTable.string(), fmt.Sprintf("%s,%s", allCols, *req.SoftDeleteColName), - allCols, *req.SoftDeleteColName, dstDatasetTable.string(), + srcDatasetTable.string(), fmt.Sprintf("%s,%s", allColsWithoutAlias, *req.SoftDeleteColName), + allColsWithAlias, *req.SoftDeleteColName, dstDatasetTable.string(), pkeyCols, pkeyCols, srcDatasetTable.string()) c.logger.Info(q)