jackye1995 commented on code in PR #6807:
URL: https://github.com/apache/iceberg/pull/6807#discussion_r1104846908
##########
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);
Review Comment:
nit: we should prefer to add a description for all the assertions, there are
many `assertNull` here that lack description
##########
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);
Review Comment:
nit: we should prefer to add a description for all the assertions, there are
many `assertEquals` and `assertNull` here that lack description
--
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]