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/06/15 18:55:45 UTC

[GitHub] [iceberg] kbendick commented on a diff in pull request #5052: [CORE] Add SerDe tests for CreateTableRequest

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