Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 13, 2024
1 parent 2401990 commit 385c7d1
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions clients/bigquery/dialect/dialect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,32 +208,7 @@ func TestBuildProcessToastStructColExpression(t *testing.T) {
}

func TestBuildColumnsUpdateFragment(t *testing.T) {
type testCase struct {
name string
columns []columns.Column
expectedString string
}

fooBarCols := []string{"foo", "bar"}

var (
lastCaseColTypes []columns.Column
lastCaseEscapeTypes []columns.Column
)
for _, col := range fooBarCols {
column := columns.NewColumn(col, typing.String)
column.ToastColumn = false
}
for _, col := range fooBarCols {
var toastCol bool
if col == "foo" {
toastCol = true
}

column := columns.NewColumn(col, typing.String)
column.ToastColumn = toastCol
}

var lastCaseColTypes []columns.Column
lastCaseCols := []string{"a1", "b2", "c3"}
for _, lastCaseCol := range lastCaseCols {
kd := typing.String
Expand All @@ -251,6 +226,7 @@ func TestBuildColumnsUpdateFragment(t *testing.T) {
lastCaseColTypes = append(lastCaseColTypes, column)
}

var lastCaseEscapeTypes []columns.Column
lastCaseColsEsc := []string{"a1", "b2", "c3", "start", "select"}
for _, lastCaseColEsc := range lastCaseColsEsc {
kd := typing.String
Expand All @@ -274,7 +250,11 @@ func TestBuildColumnsUpdateFragment(t *testing.T) {
lastCaseEscapeTypes = append(lastCaseEscapeTypes, columns.NewColumn(constants.DeleteColumnMarker, typing.Boolean))

key := `{"key":"__debezium_unavailable_value"}`
testCases := []testCase{
testCases := []struct {
name string
columns []columns.Column
expectedString string
}{
{
name: "struct, string and toast string (bigquery)",
columns: lastCaseColTypes,
Expand Down

0 comments on commit 385c7d1

Please sign in to comment.