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

Reply via email to