Skip to content

Commit

Permalink
Merge branch 'master' into minor-improvement-bigquery-cast-col
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored May 1, 2024
2 parents e678dec + 55eb549 commit 3091fef
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/destination/dml/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ func TestMergeStatementSoftDelete(t *testing.T) {
PrimaryKeys: []columns.Wrapper{columns.NewWrapper(columns.NewColumn("id", typing.Invalid), false, constants.Snowflake)},
Columns: &_cols,
DestKind: constants.Snowflake,
Dialect: sql.SnowflakeDialect{UppercaseEscNames: false},
Dialect: sql.SnowflakeDialect{UppercaseEscNames: true},
SoftDelete: true,
UppercaseEscNames: ptr.ToBool(false),
UppercaseEscNames: ptr.ToBool(true),
}

mergeSQL, err := mergeArg.GetStatement()
assert.NoError(t, err)
assert.Contains(t, mergeSQL, fmt.Sprintf("MERGE INTO %s", fqTable), mergeSQL)
// Soft deletion flag being passed.
assert.Contains(t, mergeSQL, fmt.Sprintf("%s=cc.%s", constants.DeleteColumnMarker, constants.DeleteColumnMarker), mergeSQL)
assert.Contains(t, mergeSQL, `"__ARTIE_DELETE"=cc."__ARTIE_DELETE"`, mergeSQL)

assert.Equal(t, len(idempotentKey) > 0, strings.Contains(mergeSQL, fmt.Sprintf("cc.%s >= c.%s", "updated_at", "updated_at")))
}
Expand Down Expand Up @@ -164,9 +164,9 @@ func TestMergeStatementIdempotentKey(t *testing.T) {
PrimaryKeys: []columns.Wrapper{columns.NewWrapper(columns.NewColumn("id", typing.Invalid), false, constants.Snowflake)},
Columns: &_cols,
DestKind: constants.Snowflake,
Dialect: sql.SnowflakeDialect{UppercaseEscNames: false},
Dialect: sql.SnowflakeDialect{UppercaseEscNames: true},
SoftDelete: false,
UppercaseEscNames: ptr.ToBool(false),
UppercaseEscNames: ptr.ToBool(true),
}

mergeSQL, err := mergeArg.GetStatement()
Expand Down Expand Up @@ -210,9 +210,9 @@ func TestMergeStatementCompositeKey(t *testing.T) {
},
Columns: &_cols,
DestKind: constants.Snowflake,
Dialect: sql.SnowflakeDialect{UppercaseEscNames: false},
Dialect: sql.SnowflakeDialect{UppercaseEscNames: true},
SoftDelete: false,
UppercaseEscNames: ptr.ToBool(false),
UppercaseEscNames: ptr.ToBool(true),
}

mergeSQL, err := mergeArg.GetStatement()
Expand Down

0 comments on commit 3091fef

Please sign in to comment.