Skip to content

Commit

Permalink
Update BQ Test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Nov 17, 2024
1 parent 2865543 commit fc2620f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions clients/bigquery/dialect/dialect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,23 @@ func TestBigQueryDialect_BuildCreateTableQuery(t *testing.T) {
)
}

func TestBigQueryDialect_BuildAlterColumnQuery(t *testing.T) {
func TestBigQueryDialect_BuildDropColumnQuery(t *testing.T) {
fakeTableID := &mocks.FakeTableIdentifier{}
fakeTableID.FullyQualifiedNameReturns("{TABLE}")

assert.Equal(t,
"ALTER TABLE {TABLE} drop COLUMN {SQL_PART}",
BigQueryDialect{}.buildAlterColumnQuery(fakeTableID, constants.Delete, "{SQL_PART}"),
BigQueryDialect{}.BuildDropColumnQuery(fakeTableID, "{SQL_PART}"),
)
}

func TestBigQueryDialect_BuildAddColumnQuery(t *testing.T) {
fakeTableID := &mocks.FakeTableIdentifier{}
fakeTableID.FullyQualifiedNameReturns("{TABLE}")

assert.Equal(t,
"ALTER TABLE {TABLE} add COLUMN {SQL_PART}",
BigQueryDialect{}.BuildAddColumnQuery(fakeTableID, "{SQL_PART}"),
)
}

Expand Down

0 comments on commit fc2620f

Please sign in to comment.