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/07/11 05:49:40 UTC

[GitHub] [iceberg] jfz commented on a diff in pull request #5230: Core,API: Add table property transform to support stateful property update.

jfz commented on code in PR #5230:
URL: https://github.com/apache/iceberg/pull/5230#discussion_r917561856


##########
core/src/main/java/org/apache/iceberg/PropertiesUpdate.java:
##########
@@ -53,18 +55,34 @@ public UpdateProperties set(String key, String value) {
     Preconditions.checkNotNull(value, "Value cannot be null");
     Preconditions.checkArgument(!removals.contains(key),
         "Cannot remove and update the same key: %s", key);
+    Preconditions.checkArgument(!transforms.containsKey(key),
+        "Cannot transform and update the same key: %s", key);
 
     updates.put(key, value);
 
     return this;
   }
 
+  @Override
+  public UpdateProperties transform(String key, Function<String, String> transformFunc) {
+    Preconditions.checkNotNull(key, "Key cannot be null");
+    Preconditions.checkNotNull(transformFunc, "Transform function cannot be null");
+    Preconditions.checkArgument(!updates.containsKey(key),
+        "Cannot updates and transform the same key: %s", key);

Review Comment:
   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.

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