Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
aokolnychyi committed Sep 19, 2023
1 parent d8e0a36 commit 0112fc2
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ public void testMergeWithAllClauses() {
"Should have expected rows",
ImmutableList.of(
row(1, "emp-id-1"), // updated (matched)
// row(2, "emp-id-two) // deleted (matched)
row(3, "invalid"), // updated (not matched by source)
// row(4, "emp-id-4) // deleted (not matched by source)
row(5, "emp-id-5")), // new
sql("SELECT * FROM %s ORDER BY id", selectTarget()));
}
Expand All @@ -160,7 +162,7 @@ public void testMergeWithOneNotMatchedBySourceClause() {
+ "{ \"id\": 3, \"dep\": \"emp-id-3\" }\n"
+ "{ \"id\": 4, \"dep\": \"emp-id-4\" }");

createOrReplaceView("source", Collections.singletonList(1), Encoders.INT());
createOrReplaceView("source", ImmutableList.of(1, 4), Encoders.INT());

sql(
"MERGE INTO %s AS t USING source AS s "
Expand All @@ -171,7 +173,11 @@ public void testMergeWithOneNotMatchedBySourceClause() {

assertEquals(
"Should have expected rows",
ImmutableList.of(row(1, "emp-id-1")), // existing
ImmutableList.of(
row(1, "emp-id-1"), // existing
// row(2, "emp-id-2) // deleted (not matched by source)
// row(3, "emp-id-3") // deleted (not matched by source)
row(4, "emp-id-4")), // existing
sql("SELECT * FROM %s ORDER BY id", selectTarget()));
}

Expand Down

0 comments on commit 0112fc2

Please sign in to comment.