rdblue commented on code in PR #6965:
URL: https://github.com/apache/iceberg/pull/6965#discussion_r1125768820


##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMerge.java:
##########
@@ -186,11 +189,14 @@ public void testMergeWithStaticPredicatePushDown() {
             row(2L, "hardware") // new
             );
     assertEquals(
-        "Output should match", expectedRows, sql("SELECT * FROM %s ORDER BY 
id, dep", tableName));
+        "Output should match",
+        expectedRows,
+        sql("SELECT * FROM %s ORDER BY id, dep", selectTarget()));
   }
 
   @Test
   public void testMergeIntoEmptyTargetInsertAllNonMatchingRows() {
+    Assume.assumeTrue("Branch can only be used for non-empty table", branch == 
null);

Review Comment:
   I got this working for `main` using the change suggested in 
https://github.com/apache/iceberg/pull/6965/files#r1125768603 and this update 
to `useRef`:
   
   ```java
     public ThisT useRef(String name) {
       Preconditions.checkArgument(
           snapshotId() == null, "Cannot override ref, already set snapshot 
id=%s", snapshotId());
       Snapshot snapshot = table().snapshot(name);
       Preconditions.checkArgument(snapshot != null || name.equals("main"), 
"Cannot find ref %s", name);
       if (snapshot != null) {
         return newRefinedScan(table(), tableSchema(), 
context().useSnapshotId(snapshot.snapshotId()));
       } else {
         return newRefinedScan(table(), tableSchema(), context());
       }
     }
   ```



-- 
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]

Reply via email to