From 4deafcea81357f9e6b52b086d9e0ee78d39ad21d Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Thu, 12 Dec 2024 14:58:41 -0800 Subject: [PATCH] Clean up. --- clients/mssql/dialect/dialect.go | 2 +- clients/shared/merge.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/clients/mssql/dialect/dialect.go b/clients/mssql/dialect/dialect.go index b2773ef8..87b2ce25 100644 --- a/clients/mssql/dialect/dialect.go +++ b/clients/mssql/dialect/dialect.go @@ -46,7 +46,7 @@ func (MSSQLDialect) IsTableDoesNotExistErr(err error) bool { func (md MSSQLDialect) BuildIsNotToastValueExpression(tableAlias constants.TableAlias, column columns.Column) string { toastedValue := "%" + constants.ToastUnavailableValuePlaceholder + "%" colName := sql.QuoteTableAliasColumn(tableAlias, column, md) - return fmt.Sprintf("COALESCE(%s NOT LIKE '%s', TRUE)", colName, toastedValue) + return fmt.Sprintf("COALESCE(%s, '') NOT LIKE '%s'", colName, toastedValue) } func (MSSQLDialect) BuildDedupeTableQuery(_ sql.TableIdentifier, _ []string) string { diff --git a/clients/shared/merge.go b/clients/shared/merge.go index 51392e31..743c7e31 100644 --- a/clients/shared/merge.go +++ b/clients/shared/merge.go @@ -151,8 +151,6 @@ func Merge(ctx context.Context, dwh destination.DataWarehouse, tableData *optimi return fmt.Errorf("failed to generate merge statements: %w", err) } - fmt.Println("mergeStatements", mergeStatements) - if err = destination.ExecStatements(dwh, mergeStatements); err != nil { return fmt.Errorf("failed to execute merge statements: %w", err) }