diff --git a/clients/bigquery/dialect/dialect_test.go b/clients/bigquery/dialect/dialect_test.go index 61476b446..0fe35f6f8 100644 --- a/clients/bigquery/dialect/dialect_test.go +++ b/clients/bigquery/dialect/dialect_test.go @@ -207,6 +207,12 @@ func TestBuildProcessToastStructColExpression(t *testing.T) { assert.Equal(t, `CASE WHEN COALESCE(TO_JSON_STRING(cc.foo) != '{"key":"__debezium_unavailable_value"}', true) THEN cc.foo ELSE c.foo END`, BigQueryDialect{}.BuildProcessToastStructColExpression("foo")) } +func TestQuoteColumns(t *testing.T) { + assert.Equal(t, []string{}, columns.QuoteColumns(nil, BigQueryDialect{})) + cols := []columns.Column{columns.NewColumn("a", typing.Invalid), columns.NewColumn("b", typing.Invalid)} + assert.Equal(t, []string{"`a`", "`b`"}, columns.QuoteColumns(cols, BigQueryDialect{})) +} + func TestBuildColumnsUpdateFragment(t *testing.T) { var lastCaseColTypes []columns.Column lastCaseCols := []string{"a1", "b2", "c3"} diff --git a/clients/snowflake/dialect/dialect_test.go b/clients/snowflake/dialect/dialect_test.go index c4c0f78e2..31685fe5e 100644 --- a/clients/snowflake/dialect/dialect_test.go +++ b/clients/snowflake/dialect/dialect_test.go @@ -252,6 +252,12 @@ func TestBuildProcessToastStructColExpression(t *testing.T) { assert.Equal(t, `CASE WHEN COALESCE(cc.foo != {'key': '__debezium_unavailable_value'}, true) THEN cc.foo ELSE c.foo END`, SnowflakeDialect{}.BuildProcessToastStructColExpression("foo")) } +func TestQuoteColumns(t *testing.T) { + assert.Equal(t, []string{}, columns.QuoteColumns(nil, SnowflakeDialect{})) + cols := []columns.Column{columns.NewColumn("a", typing.Invalid), columns.NewColumn("b", typing.Invalid)} + assert.Equal(t, []string{`"A"`, `"B"`}, columns.QuoteColumns(cols, SnowflakeDialect{})) +} + func TestBuildColumnsUpdateFragment(t *testing.T) { var stringAndToastCols []columns.Column for _, col := range []string{"foo", "bar"} {