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/10/28 22:02:35 UTC

[GitHub] [iceberg] rdblue opened a new pull request #1677: Fix replaced partitions validation in SnapshotManager

rdblue opened a new pull request #1677:
URL: https://github.com/apache/iceberg/pull/1677


   Fixes a minor bug in SnapshotManager validation when the table has no current snapshot.


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


[GitHub] [iceberg] rdblue commented on a change in pull request #1677: Fix replaced partitions validation in SnapshotManager

Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1677:
URL: https://github.com/apache/iceberg/pull/1677#discussion_r514438198



##########
File path: core/src/main/java/org/apache/iceberg/SnapshotManager.java
##########
@@ -255,7 +255,7 @@ private static void validateNonAncestor(TableMetadata meta, long snapshotId) {
 
   private static void validateReplacedPartitions(TableMetadata meta, Long parentId,
                                                  PartitionSet replacedPartitions) {
-    if (replacedPartitions != null) {
+    if (replacedPartitions != null && meta.currentSnapshot() != null) {

Review comment:
       Looks like we should fix that one as well. I think you should be able to FF to any snapshot if there is no current snapshot. Thanks @HeartSaVioR!




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


[GitHub] [iceberg] aokolnychyi merged pull request #1677: Fix replaced partitions validation in SnapshotManager

Posted by GitBox <gi...@apache.org>.
aokolnychyi merged pull request #1677:
URL: https://github.com/apache/iceberg/pull/1677


   


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


[GitHub] [iceberg] aokolnychyi commented on pull request #1677: Fix replaced partitions validation in SnapshotManager

Posted by GitBox <gi...@apache.org>.
aokolnychyi commented on pull request #1677:
URL: https://github.com/apache/iceberg/pull/1677#issuecomment-718941801


   I've created an issue so that we don't forget.


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


[GitHub] [iceberg] HeartSaVioR commented on a change in pull request #1677: Fix replaced partitions validation in SnapshotManager

Posted by GitBox <gi...@apache.org>.
HeartSaVioR commented on a change in pull request #1677:
URL: https://github.com/apache/iceberg/pull/1677#discussion_r514097825



##########
File path: core/src/main/java/org/apache/iceberg/SnapshotManager.java
##########
@@ -255,7 +255,7 @@ private static void validateNonAncestor(TableMetadata meta, long snapshotId) {
 
   private static void validateReplacedPartitions(TableMetadata meta, Long parentId,
                                                  PartitionSet replacedPartitions) {
-    if (replacedPartitions != null) {
+    if (replacedPartitions != null && meta.currentSnapshot() != null) {

Review comment:
       Dumb question here: is it safe for `validateCurrentSnapshot` to not check `meta.currentSnapshot() != null` in prior? If `requiredCurrentSnapshotId` is not null and `meta.currentSnapshot()` is null then NPE would occur, but I'm not sure the possibility about 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



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