nastra commented on code in PR #8086:
URL: https://github.com/apache/iceberg/pull/8086#discussion_r1269158145
##########
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:
yes, this would restore the behavior I mentioned above, but it would change
a different behavior where `ALTER TABLE x CREATE TAG t` is expected to fail
when `t` already exists. The conditions are quite tricky unfortunately and from
what I've seen is that we need to explicitly handle `create && replace &&
!refExists`
--
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]