You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "nastra (via GitHub)" <gi...@apache.org> on 2023/06/23 06:17:38 UTC

[GitHub] [iceberg] nastra opened a new pull request, #7887: Core: Ensure operation can only be set to create/replace in ViewVersion

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

   According to the [View Spec](https://iceberg.apache.org/view-spec/#summary) the `operation` must be set to either `create` or `replace`, so this makes sure that this can't be set to a random value


-- 
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] nastra closed pull request #7887: Core: Ensure operation can only be set to create/replace in ViewVersion

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra closed pull request #7887: Core: Ensure operation can only be set to create/replace in ViewVersion
URL: https://github.com/apache/iceberg/pull/7887


-- 
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 a diff in pull request #7887: Core: Ensure operation can only be set to create/replace in ViewVersion

Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on code in PR #7887:
URL: https://github.com/apache/iceberg/pull/7887#discussion_r1240041874


##########
api/src/main/java/org/apache/iceberg/view/ViewVersion.java:
##########
@@ -78,5 +78,10 @@ default String operation() {
   default void check() {
     Preconditions.checkArgument(
         summary().containsKey("operation"), "Invalid view version summary, missing operation");
+    String operation = summary().get("operation");
+    Preconditions.checkArgument(
+        "create".equals(operation) || "replace".equals(operation),
+        "Invalid operation. Must be create or replace but was: %s",
+        operation);

Review Comment:
   Won't this prevent loading any view with a bad operation? That doesn't seem like something that should completely break a view.



-- 
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 #7887: Core: Ensure operation can only be set to create/replace in ViewVersion

Posted by "rdblue (via GitHub)" <gi...@apache.org>.
rdblue commented on PR #7887:
URL: https://github.com/apache/iceberg/pull/7887#issuecomment-1604794436

   I don't think this is necessary. Tables don't validate this and don't fail to load if it is invalid.


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