You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/11/05 07:32:41 UTC

[GitHub] [iceberg] HeartSaVioR commented on a change in pull request #1720: Publish incremental scan event during planning

HeartSaVioR commented on a change in pull request #1720:
URL: https://github.com/apache/iceberg/pull/1720#discussion_r517841373



##########
File path: core/src/test/java/org/apache/iceberg/TestIncrementalDataTableScan.java
##########
@@ -78,8 +81,28 @@ public void testAppends() {
     add(table.newAppend(), files("C"));
     add(table.newAppend(), files("D"));
     add(table.newAppend(), files("E")); // 5
+
+    class MyListener implements Listener<IncrementalScanEvent> {
+
+      IncrementalScanEvent lastEvent = null;
+
+      public void notify(IncrementalScanEvent event) {
+        this.lastEvent = event;
+      }
+
+      public IncrementalScanEvent event() {
+        return lastEvent;
+      }
+    }
+
+    MyListener listener1 = new MyListener();
+    Listeners.register(listener1, IncrementalScanEvent.class);
     filesMatch(Lists.newArrayList("B", "C", "D", "E"), appendsBetweenScan(1, 5));
+    Assert.assertTrue(listener1.event().fromSnapshotId() == 1);

Review comment:
       I'm in favor of check all fields as it's the only test verifying IncrementalScanEvent, but others may have different thought on this.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org