szehon-ho commented on a change in pull request #3273:
URL: https://github.com/apache/iceberg/pull/3273#discussion_r731548752



##########
File path: core/src/main/java/org/apache/iceberg/DataFiles.java
##########
@@ -285,7 +285,12 @@ public DataFile build() {
       }
       Preconditions.checkArgument(format != null, "File format is required");
       Preconditions.checkArgument(fileSizeInBytes >= 0, "File size is 
required");
-      Preconditions.checkArgument(recordCount >= 0, "Record count is 
required");
+      Preconditions.checkArgument(recordCount != null, "Record count is 
required");
+      // MetricsEvaluator skips using other metrics, if record count is -1
+      Preconditions.checkArgument(recordCount >= 0 ||
+              (recordCount == -1 && valueCounts == null && columnSizes == null 
&& nanValueCounts == null &&
+                      lowerBounds == null && upperBounds == null),
+          "Metrics cannot be set if record count is -1.");

Review comment:
       OK I will give this a try.  @kbendick  I guess we won't have -1 anymore 
in this case?




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