RussellSpitzer commented on a change in pull request #4451:
URL: https://github.com/apache/iceberg/pull/4451#discussion_r840981080



##########
File path: 
spark/v3.2/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestRemoveOrphanFilesProcedure.java
##########
@@ -360,4 +360,29 @@ public void testRemoveOrphanFilesWithDeleteFiles() throws 
Exception {
         .collectAsList();
     Assert.assertEquals("Rows must match", records, actualRecords);
   }
+
+  @Test
+  public void testRemoveOrphanFilesWithStreamResultsEnabled() throws Exception 
{
+    sql("CREATE TABLE %s (id bigint NOT NULL) USING iceberg", tableName);
+    sql("INSERT INTO TABLE %s VALUES (1)", tableName);
+    Dataset<Row> df = spark.sql(String.format("select * from %s", tableName));
+    Table table = Spark3Util.loadIcebergTable(spark, tableName);
+    df.write().parquet(table.location() + "/data/orphan_files");
+    Thread.sleep(1000);
+    Timestamp currentTimestamp = 
Timestamp.from(Instant.ofEpochMilli(System.currentTimeMillis()));
+    List<Object[]> dryRunOutput = sql(
+            "CALL %s.system.remove_orphan_files(" +
+                    "table => '%s'," +
+                    "older_than => TIMESTAMP '%s'," +
+                    "dry_run => true)",
+            catalogName, tableIdent, currentTimestamp);
+    List<Object[]> streamResultsOutput = sql(

Review comment:
       There should probably be a test in here that we are actually streaming 
results.  See
   
   
https://github.com/apache/iceberg/blob/3a0cc769a2f5859a0f930a7d9a026c86cd52546a/spark/src/test/java/org/apache/iceberg/actions/TestExpireSnapshotsAction.java#L1058-L1060




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

Reply via email to