From 715fd3626226843cf68050ac446db938c380252a Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Mon, 8 Jan 2024 03:12:27 +0530 Subject: [PATCH 1/2] fix update statements to split unchangedToastCols properly --- flow/connectors/bigquery/merge_statement_generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/connectors/bigquery/merge_statement_generator.go b/flow/connectors/bigquery/merge_statement_generator.go index 47dd2b3936..3582f5a2f6 100644 --- a/flow/connectors/bigquery/merge_statement_generator.go +++ b/flow/connectors/bigquery/merge_statement_generator.go @@ -204,7 +204,7 @@ func (m *mergeStmtGenerator) generateUpdateStatements( updateStmts := make([]string, 0, len(unchangedToastCols)) for _, cols := range unchangedToastCols { - unchangedColsArray := strings.Split(cols, ", ") + unchangedColsArray := strings.Split(cols, ",") otherCols := utils.ArrayMinus(allCols, unchangedColsArray) tmpArray := make([]string, 0, len(otherCols)) for _, colName := range otherCols { From 061b85185748965f0c5a65a280185afe03989e42 Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Mon, 8 Jan 2024 03:27:39 +0530 Subject: [PATCH 2/2] fixing tests which had bad input :( --- flow/connectors/bigquery/merge_stmt_generator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/connectors/bigquery/merge_stmt_generator_test.go b/flow/connectors/bigquery/merge_stmt_generator_test.go index 0818caed56..141b3999b7 100644 --- a/flow/connectors/bigquery/merge_stmt_generator_test.go +++ b/flow/connectors/bigquery/merge_stmt_generator_test.go @@ -17,7 +17,7 @@ func TestGenerateUpdateStatement_WithUnchangedToastCols(t *testing.T) { }, } allCols := []string{"col1", "col2", "col3"} - unchangedToastCols := []string{"", "col2, col3", "col2", "col3"} + unchangedToastCols := []string{"", "col2,col3", "col2", "col3"} expected := []string{ "WHEN MATCHED AND _rt!=2 AND _ut=''" +