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/02/05 23:56:00 UTC

[GitHub] [incubator-iceberg] rdsr opened a new pull request #782: Incremental scan followups

rdsr opened a new pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782
 
 
   Fixes: #765: This addresses the following follow-ups from #315
   
   1. Have validations on snapshot id range
   2. Improve tests for the same

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdsr commented on a change in pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#discussion_r377410460
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java
 ##########
 @@ -137,4 +136,29 @@ protected TableScan newRefinedScan(
     }
     return snapshots;
   }
+
+  private void validateSnapshotIdsRefinement(long newFromSnapshotId, long newToSnapshotId) {
+    Set<Long> snapshotIdsRange = Sets.newHashSet(
+        SnapshotUtil.snapshotIdsBetween(table(), fromSnapshotId, toSnapshotId));
+    // since snapshotIdsBetween return ids in range (fromSnapshotId, toSnapshotId]
+    snapshotIdsRange.add(fromSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newFromSnapshotId),
+        "newFromSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newFromSnapshotId, fromSnapshotId, newToSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newToSnapshotId),
+        "newToSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newToSnapshotId, fromSnapshotId, toSnapshotId);
+  }
+
+  private static void validateSnapshotIds(Table table, long fromSnapshotId, long toSnapshotId) {
+    Preconditions.checkArgument(fromSnapshotId != toSnapshotId, "fromSnapshotId and toSnapshotId cannot be the same");
 
 Review comment:
   oops. I'll fix it

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdsr commented on a change in pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#discussion_r377408828
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java
 ##########
 @@ -137,4 +136,29 @@ protected TableScan newRefinedScan(
     }
     return snapshots;
   }
+
+  private void validateSnapshotIdsRefinement(long newFromSnapshotId, long newToSnapshotId) {
+    Set<Long> snapshotIdsRange = Sets.newHashSet(
+        SnapshotUtil.snapshotIdsBetween(table(), fromSnapshotId, toSnapshotId));
+    // since snapshotIdsBetween return ids in range (fromSnapshotId, toSnapshotId]
+    snapshotIdsRange.add(fromSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newFromSnapshotId),
+        "newFromSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newFromSnapshotId, fromSnapshotId, newToSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newToSnapshotId),
+        "newToSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newToSnapshotId, fromSnapshotId, toSnapshotId);
+  }
+
+  private static void validateSnapshotIds(Table table, long fromSnapshotId, long toSnapshotId) {
+    Preconditions.checkArgument(fromSnapshotId != toSnapshotId, "fromSnapshotId and toSnapshotId cannot be the same");
 
 Review comment:
   Makes sense. Fixed

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdsr commented on issue #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdsr commented on issue #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#issuecomment-584463615
 
 
   Python build failed. Seems like the failure is unrelated.
   ```
   ERROR: invocation failed (exit code 1), logfile: /home/travis/build/apache/incubator-iceberg/python/.tox/py36/log/py36-0.log
   ================================== log start ===================================
   ERROR:root:ImportError: cannot import name 'ensure_text'
   =================================== log end ====================================
   ERROR: InvocationError for command /home/travis/virtualenv/python3.6.3/bin/python -m virtualenv --no-download --python /home/travis/virtualenv/python3.6.3/bin/python py36 (exited with code 1)
   ___________________________________ summary ____________________________________
   ERROR:   py36: InvocationError for command /home/travis/virtualenv/python3.6.3/bin/python -m virtualenv --no-download --python /home/travis/virtualenv/python3.6.3/bin/python py36 (exited with code 1)
   The command "tox" exited with 1.
   ```

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue merged pull request #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdblue merged pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782
 
 
   

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on issue #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdblue commented on issue #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#issuecomment-584817879
 
 
   +1
   
   I'll merge this with the test failure because those are Python and aren't related.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#discussion_r377409714
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java
 ##########
 @@ -137,4 +136,29 @@ protected TableScan newRefinedScan(
     }
     return snapshots;
   }
+
+  private void validateSnapshotIdsRefinement(long newFromSnapshotId, long newToSnapshotId) {
+    Set<Long> snapshotIdsRange = Sets.newHashSet(
+        SnapshotUtil.snapshotIdsBetween(table(), fromSnapshotId, toSnapshotId));
+    // since snapshotIdsBetween return ids in range (fromSnapshotId, toSnapshotId]
+    snapshotIdsRange.add(fromSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newFromSnapshotId),
+        "newFromSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newFromSnapshotId, fromSnapshotId, newToSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newToSnapshotId),
+        "newToSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newToSnapshotId, fromSnapshotId, toSnapshotId);
+  }
+
+  private static void validateSnapshotIds(Table table, long fromSnapshotId, long toSnapshotId) {
+    Preconditions.checkArgument(fromSnapshotId != toSnapshotId, "fromSnapshotId and toSnapshotId cannot be the same");
 
 Review comment:
   Looks like you missed the test assertions.

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


With regards,
Apache Git Services

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


[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #782: Incremental scan followups

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #782: Incremental scan followups
URL: https://github.com/apache/incubator-iceberg/pull/782#discussion_r377404270
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/IncrementalDataTableScan.java
 ##########
 @@ -137,4 +136,29 @@ protected TableScan newRefinedScan(
     }
     return snapshots;
   }
+
+  private void validateSnapshotIdsRefinement(long newFromSnapshotId, long newToSnapshotId) {
+    Set<Long> snapshotIdsRange = Sets.newHashSet(
+        SnapshotUtil.snapshotIdsBetween(table(), fromSnapshotId, toSnapshotId));
+    // since snapshotIdsBetween return ids in range (fromSnapshotId, toSnapshotId]
+    snapshotIdsRange.add(fromSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newFromSnapshotId),
+        "newFromSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newFromSnapshotId, fromSnapshotId, newToSnapshotId);
+    Preconditions.checkArgument(
+        snapshotIdsRange.contains(newToSnapshotId),
+        "newToSnapshotId %s not in existing snapshot ids range (%s, %s]",
+        newToSnapshotId, fromSnapshotId, toSnapshotId);
+  }
+
+  private static void validateSnapshotIds(Table table, long fromSnapshotId, long toSnapshotId) {
+    Preconditions.checkArgument(fromSnapshotId != toSnapshotId, "fromSnapshotId and toSnapshotId cannot be the same");
 
 Review comment:
   I'd like to avoid using argument names in error messages. Argument names aren't very readable for end users because they are dense and this practice requires changing strings and test cases if arguments get renamed later.
   
   How about "From and to snapshot IDs cannot be the same: (%s, %s]", "From snapshot does not exist: %s", etc.

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


With regards,
Apache Git Services

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