nastra commented on code in PR #8086:
URL: https://github.com/apache/iceberg/pull/8086#discussion_r1267597261


##########
spark/v3.4/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/CreateOrReplaceTagExec.scala:
##########
@@ -50,15 +51,19 @@ case class CreateOrReplaceTagExec(
           "Cannot complete create or replace tag operation on %s, main has no 
snapshot", ident)
 
         val manageSnapshot = iceberg.table.manageSnapshots()
-        if (!replace) {
+        if (create && replace && null == iceberg.table().refs().get(tag)) {

Review Comment:
   that will change the expected behavior unfortunaly. Tests are expecting 
`ALTER TABLE x REPLACE TAG non-existing` to throw an exception, therefore we 
need to distinguish whether `CREATE OR REPLACE` is used here vs `REPLACE`



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