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 2022/08/08 22:41:23 UTC

[GitHub] [iceberg] namrathamyske opened a new pull request, #5475: Core, API: Support scanning from a tag

namrathamyske opened a new pull request, #5475:
URL: https://github.com/apache/iceberg/pull/5475

   As addressed by https://github.com/apache/iceberg/pull/5150#issuecomment-1207452921, creating a separate PR for tags.
   
   https://github.com/apache/iceberg/pull/5150 make use of this PR. 
   
   @amogh-jahagirdar @rdblue let me know what you think!


-- 
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: issues-unsubscribe@iceberg.apache.org

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] hililiwei commented on a diff in pull request #5475: Core, API: Support scanning from a tag

Posted by GitBox <gi...@apache.org>.
hililiwei commented on code in PR #5475:
URL: https://github.com/apache/iceberg/pull/5475#discussion_r940806751


##########
core/src/main/java/org/apache/iceberg/DataTableScan.java:
##########
@@ -68,6 +68,14 @@ public TableScan useSnapshot(long scanSnapshotId) {
         tableOps(), table(), snapshotSchema, context().useSnapshotId(scanSnapshotId));
   }
 
+  @Override
+  public TableScan useTag(String tag) {
+    Preconditions.checkArgument(table().snapshot(tag) != null, "Cannot find tag with name %s", tag);
+    Preconditions.checkArgument(
+        table().refs().get(tag).isTag(), "Ref %s is a branch, not a tag", tag);
+    return useSnapshot(table().snapshot(tag).snapshotId());

Review Comment:
   ````
       SnapshotRef ref = tableOps().current().ref(tag);
       Preconditions.checkArgument(ref != null, "Tag does not exist: %s", name);
       Preconditions.checkArgument(ref.isTag(), "Ref %s is a tag not a branch", tag);
   ```
   The error message is modified to be consistent with that in UpdateSnapshotReferencesOperations.
   
   https://github.com/apache/iceberg/blob/f76e9cb2b72f3ce242a50258ff27be23f6d5aea3/core/src/main/java/org/apache/iceberg/UpdateSnapshotReferencesOperation.java#L78-L96
   
   
   



-- 
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: issues-unsubscribe@iceberg.apache.org

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 pull request #5475: Core, API: Support scanning from a tag

Posted by GitBox <gi...@apache.org>.
rdblue commented on PR #5475:
URL: https://github.com/apache/iceberg/pull/5475#issuecomment-1211383878

   I think we've decided to go with `useRef` rather than separate tag and branch methods. I'll close this. Thanks, @namrathamyske!


-- 
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: issues-unsubscribe@iceberg.apache.org

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] hililiwei commented on a diff in pull request #5475: Core, API: Support scanning from a tag

Posted by GitBox <gi...@apache.org>.
hililiwei commented on code in PR #5475:
URL: https://github.com/apache/iceberg/pull/5475#discussion_r940806751


##########
core/src/main/java/org/apache/iceberg/DataTableScan.java:
##########
@@ -68,6 +68,14 @@ public TableScan useSnapshot(long scanSnapshotId) {
         tableOps(), table(), snapshotSchema, context().useSnapshotId(scanSnapshotId));
   }
 
+  @Override
+  public TableScan useTag(String tag) {
+    Preconditions.checkArgument(table().snapshot(tag) != null, "Cannot find tag with name %s", tag);
+    Preconditions.checkArgument(
+        table().refs().get(tag).isTag(), "Ref %s is a branch, not a tag", tag);
+    return useSnapshot(table().snapshot(tag).snapshotId());

Review Comment:
   ```
       SnapshotRef ref = tableOps().current().ref(tag);
       Preconditions.checkArgument(ref != null, "Tag does not exist: %s", name);
       Preconditions.checkArgument(ref.isTag(), "Ref %s is a tag not a branch", tag);
   ```
   The error message is modified to be consistent with that in UpdateSnapshotReferencesOperations.
   https://github.com/apache/iceberg/blob/f76e9cb2b72f3ce242a50258ff27be23f6d5aea3/core/src/main/java/org/apache/iceberg/UpdateSnapshotReferencesOperation.java#L78-L96
   
   
   
   



-- 
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: issues-unsubscribe@iceberg.apache.org

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] hililiwei commented on a diff in pull request #5475: Core, API: Support scanning from a tag

Posted by GitBox <gi...@apache.org>.
hililiwei commented on code in PR #5475:
URL: https://github.com/apache/iceberg/pull/5475#discussion_r940806751


##########
core/src/main/java/org/apache/iceberg/DataTableScan.java:
##########
@@ -68,6 +68,14 @@ public TableScan useSnapshot(long scanSnapshotId) {
         tableOps(), table(), snapshotSchema, context().useSnapshotId(scanSnapshotId));
   }
 
+  @Override
+  public TableScan useTag(String tag) {
+    Preconditions.checkArgument(table().snapshot(tag) != null, "Cannot find tag with name %s", tag);
+    Preconditions.checkArgument(
+        table().refs().get(tag).isTag(), "Ref %s is a branch, not a tag", tag);
+    return useSnapshot(table().snapshot(tag).snapshotId());

Review Comment:
   ```
       SnapshotRef ref = tableOps().current().ref(tag);
       Preconditions.checkArgument(ref != null, "Tag does not exist: %s", tag);
       Preconditions.checkArgument(ref.isTag(), "Ref %s is a tag not a branch", tag);
   ```
   The error message is modified to be consistent with that in UpdateSnapshotReferencesOperations.
   https://github.com/apache/iceberg/blob/f76e9cb2b72f3ce242a50258ff27be23f6d5aea3/core/src/main/java/org/apache/iceberg/UpdateSnapshotReferencesOperation.java#L78-L96
   
   
   
   



-- 
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: issues-unsubscribe@iceberg.apache.org

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 closed pull request #5475: Core, API: Support scanning from a tag

Posted by GitBox <gi...@apache.org>.
rdblue closed pull request #5475: Core, API: Support scanning from a tag
URL: https://github.com/apache/iceberg/pull/5475


-- 
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: issues-unsubscribe@iceberg.apache.org

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