amogh-jahagirdar commented on code in PR #6807: URL: https://github.com/apache/iceberg/pull/6807#discussion_r1104836737
########## spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestTagDDL.java: ########## @@ -264,6 +264,54 @@ public void testCreateOrReplace() throws NoSuchTableException { Assert.assertEquals(first, ref.snapshotId()); } + @Test Review Comment: I think we should also have a test to ensure that DROP TAG does not work when the ref is a branch. If I missed the opposite case for DROP BRANCH, I think let's add that as well for completeness. ########## spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestTagDDL.java: ########## @@ -264,6 +264,54 @@ public void testCreateOrReplace() throws NoSuchTableException { Assert.assertEquals(first, ref.snapshotId()); } + @Test + public void testDropTag() throws NoSuchTableException { + insertRows(); + Table table = validationCatalog.loadTable(tableIdent); + String tagName = "t1"; + table.manageSnapshots().createTag(tagName, table.currentSnapshot().snapshotId()).commit(); + SnapshotRef ref = table.refs().get(tagName); + Assert.assertEquals(table.currentSnapshot().snapshotId(), ref.snapshotId()); + + sql("ALTER TABLE %s DROP TAG %s", tableName, tagName); + table.refresh(); + ref = table.refs().get(tagName); + Assert.assertNull(ref); + + AssertHelpers.assertThrows( + "Non-conforming tag name", + IcebergParseException.class, + "mismatched input '123'", + () -> sql("ALTER TABLE %s DROP TAG %s", tableName, "123")); Review Comment: I think it's fine to include this test but could we separate it and have this test just focused on the happy case? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org