dramaticlly commented on code in PR #6889:
URL: https://github.com/apache/iceberg/pull/6889#discussion_r1113432265
##########
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:
hey @hililiwei , I think today the duplicate check is based on file path
equality. Can you elaborate a bit more on why do you want to see the contents
change of this file?
I think my unit test want to cover the case where add files followed by
immediate delete will work. Before my change, this will fail with
IllegalStateException as in https://github.com/apache/iceberg/issues/6888
--
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]