hililiwei commented on code in PR #6889:
URL: https://github.com/apache/iceberg/pull/6889#discussion_r1112590628
##########
spark/v3.3/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestAddFilesProcedure.java:
##########
@@ -103,6 +103,35 @@ public void addDataUnpartitioned() {
sql("SELECT * FROM %s ORDER BY id", tableName));
}
+ @Test
+ public void deleteAndAddBackAllowed() {
+ createUnpartitionedFileTable("parquet");
+
+ String createIceberg =
+ "CREATE TABLE %s (id Integer, name String, dept String, subdept
String) USING iceberg";
+
+ sql(createIceberg, tableName);
+
+ sql(
+ "CALL %s.system.add_files('%s', '`parquet`.`%s`')",
+ catalogName, tableName, fileTableDir.getAbsolutePath());
+
+ String deleteData = "DELETE FROM %s";
+ sql(deleteData, tableName);
+
+ List<Object[]> result =
+ sql(
+ "CALL %s.system.add_files('%s', '`parquet`.`%s`')",
+ catalogName, tableName, fileTableDir.getAbsolutePath());
+
+ assertEquals("Procedure output must match", ImmutableList.of(row(2L, 1L)),
result);
Review Comment:
Should we test test cases where the contents of this file have changed?
--
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]