Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed May 3, 2024
1 parent 37a1d70 commit eaa6a47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/destination/dml/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,17 @@ func TestMergeArgument_BuildRedshiftInsertQuery(t *testing.T) {
cols := []columns.Column{
columns.NewColumn("col1", typing.Invalid),
columns.NewColumn("col2", typing.Invalid),
columns.NewColumn("col3", typing.Invalid),
}

mergeArg := MergeArgument{
TableID: MockTableIdentifier{"{TABLE_ID}"},
SubQuery: "{SUB_QUERY}",
PrimaryKeys: []columns.Column{cols[0], columns.NewColumn("othercol", typing.Invalid)},
PrimaryKeys: []columns.Column{cols[0], cols[2]},
Dialect: sql.SnowflakeDialect{},
}
assert.Equal(t,
`INSERT INTO {TABLE_ID} ("COL1","COL2") SELECT cc."COL1",cc."COL2" FROM {SUB_QUERY} as cc LEFT JOIN {TABLE_ID} as c on c."COL1" = cc."COL1" and c."OTHERCOL" = cc."OTHERCOL" WHERE c."COL1" IS NULL;`,
`INSERT INTO {TABLE_ID} ("COL1","COL2","COL3") SELECT cc."COL1",cc."COL2",cc."COL3" FROM {SUB_QUERY} as cc LEFT JOIN {TABLE_ID} as c on c."COL1" = cc."COL1" and c."COL3" = cc."COL3" WHERE c."COL1" IS NULL;`,
mergeArg.buildRedshiftInsertQuery(cols),
)
}
Expand Down

0 comments on commit eaa6a47

Please sign in to comment.