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


##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/SparkWriteConf.java:
##########
@@ -333,6 +334,28 @@ public boolean caseSensitive() {
   }
 
   public String branch() {
+    if (wapEnabled()) {
+      String wapId = wapId();
+      String wapBranch =
+          
confParser.stringConf().sessionConf(SparkSQLProperties.WAP_BRANCH).parseOptional();
+
+      ValidationException.check(
+          wapId == null || wapBranch == null,
+          "Cannot set both WAP ID and branch, but got ID [%s] and branch [%s]",
+          wapId,
+          wapBranch);
+
+      if (wapBranch != null) {
+        ValidationException.check(
+            branch == null,
+            "Cannot write to both branch and WAP branch, but got branch [%s] 
and WAP branch [%s]",
+            branch,
+            wapBranch);

Review Comment:
   I don't think this behavior is a blocker because it is strict, but I would 
expect to be able to write to another branch with the WAP branch set. I'm 
curious what other people think the long-term behavior should be.
   
   I think this behavior does help ensure that there are no side-effects, which 
is good if you want people to trust the pattern. But that's undermined by 
enabling/disabling WAP on a per-table basis.



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