Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Jan 2, 2025
1 parent daff05b commit 891fd32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions clients/redshift/dialect/dialect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ func TestRedshiftDialect_BuildIsNotToastValueExpression(t *testing.T) {
assert.Equal(t,
`
COALESCE(
CASE
WHEN JSON_SIZE(tbl."foo") < 500 THEN JSON_SERIALIZE(tbl."foo") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
CASE
WHEN JSON_SIZE(tbl."foo") < 500 THEN JSON_SERIALIZE(tbl."foo") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
)`, RedshiftDialect{}.BuildIsNotToastValueExpression("tbl", columns.NewColumn("foo", typing.Struct)),
)
}
Expand All @@ -106,12 +106,12 @@ COALESCE(
assert.Equal(t,
`
COALESCE(
CASE
WHEN JSON_SIZE(tbl."foo") < 500 THEN JSON_SERIALIZE(tbl."foo") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
CASE
WHEN JSON_SIZE(tbl."foo") < 500 THEN JSON_SERIALIZE(tbl."foo") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
)`, RedshiftDialect{}.BuildIsNotToastValueExpression("tbl", columns.NewColumn("foo", typing.Array)),
)
}
Expand Down
12 changes: 6 additions & 6 deletions lib/sql/tests/columns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ func TestBuildColumnsUpdateFragment_Redshift(t *testing.T) {
columns: lastCaseColTypes,
expectedString: `"a1"= CASE WHEN
COALESCE(
CASE
WHEN JSON_SIZE(stg."a1") < 500 THEN JSON_SERIALIZE(stg."a1") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
CASE
WHEN JSON_SIZE(stg."a1") < 500 THEN JSON_SERIALIZE(stg."a1") NOT LIKE '%__debezium_unavailable_value%'
ELSE
TRUE
END,
TRUE
) THEN stg."a1" ELSE tgt."a1" END,"b2"= CASE WHEN COALESCE(stg."b2" NOT LIKE '%__debezium_unavailable_value%', TRUE) THEN stg."b2" ELSE tgt."b2" END,"c3"=stg."c3"`,
},
}
Expand Down

0 comments on commit 891fd32

Please sign in to comment.