rdblue commented on a change in pull request #845: Add persistent IDs to
partition fields
URL: https://github.com/apache/incubator-iceberg/pull/845#discussion_r403262319
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -204,8 +205,11 @@ public String toString() {
this.lastUpdatedMillis = lastUpdatedMillis;
this.lastColumnId = lastColumnId;
this.schema = schema;
- this.specs = specs;
this.defaultSpecId = defaultSpecId;
+
+ Preconditions.checkArgument(specs != null && !specs.isEmpty(), "specs
cannot be null or empty");
+ this.specs = specs;
Review comment:
We typically validate arguments before assignments, to keep the code easier
to read and maintain. Can you move the precondition above this section? Also,
error messages should use sentence case so capitalize `Specs`. If you're
referring to a variable name, then consider describing what it is instead
(Partition specs instead of `specs`).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]