rdblue commented on code in PR #12211:
URL: https://github.com/apache/iceberg/pull/12211#discussion_r1951668597


##########
api/src/main/java/org/apache/iceberg/UpdateSchema.java:
##########
@@ -67,24 +70,52 @@ default UpdateSchema addColumn(String name, Type type) {
   }
 
   /**
-   * Add a new top-level column.
+   * Add a new optional top-level column.
    *
    * <p>Because "." may be interpreted as a column path separator or may be 
used in field names, it
    * is not allowed in names passed to this method. To add to nested 
structures or to add fields
    * with names that contain ".", use {@link #addColumn(String, String, Type)}.
    *
    * <p>If type is a nested type, its field IDs are reassigned when added to 
the existing schema.
    *
+   * <p>The added column will be optional with a null default value.
+   *
    * @param name name for the new column
    * @param type type for the new column
    * @param doc documentation string for the new column
    * @return this for method chaining
    * @throws IllegalArgumentException If name contains "."
    */
-  UpdateSchema addColumn(String name, Type type, String doc);
+  default UpdateSchema addColumn(String name, Type type, String doc) {
+    return addColumn(name, type, doc, null);
+  }
 
   /**
-   * Add a new column to a nested struct.
+   * Add a new optional top-level column.
+   *
+   * <p>Because "." may be interpreted as a column path separator or may be 
used in field names, it

Review Comment:
   This is the existing behavior, so it isn't a change being made here. The 
difference is that the check and delegation to `addColumn(null, name, type, 
doc, defaultValue)` was moved into this interface rather than having multiple 
implementations in `SchemaUpdate`.



-- 
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-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to