jackye1995 commented on code in PR #6965:
URL: https://github.com/apache/iceberg/pull/6965#discussion_r1126821279
##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMerge.java:
##########
@@ -214,11 +220,14 @@ public void
testMergeIntoEmptyTargetInsertAllNonMatchingRows() {
row(3, "emp-id-3") // new
);
assertEquals(
- "Should have expected rows", expectedRows, sql("SELECT * FROM %s ORDER
BY id", tableName));
+ "Should have expected rows",
+ expectedRows,
+ sql("SELECT * FROM %s ORDER BY id", selectTarget()));
}
@Test
public void testMergeIntoEmptyTargetInsertOnlyMatchingRows() {
+ Assume.assumeTrue("Branch can only be used for non-empty table", branch ==
null);
Review Comment:
> we will probably have to define a non-existing branch to always be at the
current table state. So if user does `SELECT * from table.branch_not_exist` it
will just read the current table instead of saying branch not found.
Actually, this is not needed. This can be explained as an experience similar
to CTAS, where you can INSERT to a table before you create the table, the table
is assumed to be there held in memory before committed. Here when running a
MERGE/DELETE/UPDATE, we are basically saying the branch will be created before
any scan and write, but it is only committed together with the write commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]