kbendick commented on code in PR #5052:
URL: https://github.com/apache/iceberg/pull/5052#discussion_r898311880


##########
core/src/main/java/org/apache/iceberg/rest/requests/CreateTableRequest.java:
##########
@@ -43,7 +43,7 @@ public class CreateTableRequest implements RESTRequest {
   private UnboundPartitionSpec spec;
   private UnboundSortOrder order;
   private Map<String, String> properties;
-  private Boolean stageCreate;
+  private Boolean stageCreate = false;

Review Comment:
   I defaulted this to `false` so that users didn't need to explicitly set it 
if writing JSON. Because it's a boxed `Boolean`, if it's not present in the 
JSON, it gets set as `null`.
   
   I did this because `CreateTableRequest` does not have `stageCreate` in its 
list of required fields in the OpenAPI spec.
   
   As there is an assertion that `stageCreate` is not `null` in the `validate` 
method of this class, I would also be comfortable with requiring that 
`stageCreate` be set in the OpenAPI spec, but I prefer this as it matches the 
builders behavior as well (if `.stageCreate()` isn't called on the builder, 
`false` is used).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to