RussellSpitzer commented on code in PR #7744:
URL: https://github.com/apache/iceberg/pull/7744#discussion_r1239078192


##########
core/src/main/java/org/apache/iceberg/DataFiles.java:
##########
@@ -248,6 +268,16 @@ public Builder withPartitionPath(String newPartitionPath) {
       return this;
     }
 
+    public Builder withPartitionValues(List<String> partitionValues) {
+      Preconditions.checkArgument(
+          isPartitioned || partitionValues.isEmpty(),
+          "Cannot add partition data for an unpartitioned table");
+      if (!partitionValues.isEmpty()) {

Review Comment:
   This is actually a little more confusing still, "fillFromValues" throws an 
error if you have the wrong number of values so currently the logic looks like
   
   1. isPartitioned + partitionValues.isEmpty - doesNothing
   2. isPartitioned + parititonValues.size != partitonSpec.size && isNotEmpty - 
Error
   3. isPartitioned + partitionValues.size == partitionSpec.size - does 
something
   4. not partitioned + partitionvalues.isEmpty - doesNothing
   5. not partitioned + parittionValues.nonEmpty - Error
   
   In my opinion here everything but 3 should be illegal. 



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