rdblue commented on code in PR #5427:
URL: https://github.com/apache/iceberg/pull/5427#discussion_r939730591
##########
api/src/main/java/org/apache/iceberg/metrics/ScanReport.java:
##########
@@ -117,12 +149,285 @@ public Builder fromScanMetrics(ScanMetrics
newScanMetrics) {
return this;
}
+ public Builder fromScanMetricsResult(ScanMetricsResult
newScanMetricsResult) {
+ this.scanMetricsResult = newScanMetricsResult;
+ return this;
+ }
+
public ScanReport build() {
Preconditions.checkArgument(null != tableName, "Invalid table name:
null");
Preconditions.checkArgument(null != filter, "Invalid expression filter:
null");
Preconditions.checkArgument(null != projection, "Invalid schema
projection: null");
+ Preconditions.checkArgument(
+ null != scanMetrics || null != scanMetricsResult, "Invalid scan
metrics: null");
+ return new ScanReport(
+ tableName,
+ snapshotId,
+ filter,
+ projection,
+ null != scanMetrics ? ScanMetricsResult.fromScanMetrics(scanMetrics)
: scanMetricsResult);
Review Comment:
Wouldn't it be simpler to convert `scanMetrics` to a result in
`fromScanMetrics` and have just `scanMetricsResult` to deal with in this method?
--
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]