nastra commented on code in PR #15104:
URL: https://github.com/apache/iceberg/pull/15104#discussion_r2799310384
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/SparkWriteUtil.java:
##########
@@ -256,4 +286,101 @@ private static SortOrder[] orderBy(Expression... exprs) {
private static SortOrder sort(Expression expr) {
return Expressions.sort(expr, SortDirection.ASCENDING);
}
+
+ public static CustomMetric[] supportedCustomMetrics() {
+ return new CustomMetric[] {
+ new AddedDataFiles(),
+ new AddedDeleteFiles(),
+ new AddedEqualityDeletes(),
+ new AddedEqualityDeleteFiles(),
+ new AddedFileSizeInBytes(),
+ new AddedPositionalDeletes(),
+ new AddedPositionalDeleteFiles(),
+ new AddedRecords(),
+ new RemovedDataFiles(),
+ new RemovedDeleteFiles(),
+ new RemovedRecords(),
+ new RemovedEqualityDeleteFiles(),
+ new RemovedEqualityDeletes(),
+ new RemovedFileSizeInBytes(),
+ new RemovedPositionalDeleteFiles(),
+ new RemovedPositionalDeletes(),
+ new TotalDataFiles(),
+ new TotalDeleteFiles(),
+ new TotalEqualityDeletes(),
+ new TotalFileSizeInBytes(),
+ new TotalPositionalDeletes(),
+ new TotalRecords()
+ };
+ }
+
+ public static CustomTaskMetric[] customTaskMetrics(InMemoryMetricsReporter
metricsReporter) {
+ List<CustomTaskMetric> taskMetrics = Lists.newArrayList();
+ if (metricsReporter != null) {
+ CommitReport commitReport = metricsReporter.commitReport();
+ if (commitReport != null) {
+ CommitMetricsResult metricsResult = commitReport.commitMetrics();
Review Comment:
```suggestion
CommitMetricsResult result = commitReport.commitMetrics();
```
this should make the code below slightly more readable and more stuff can
fit into a single line
--
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]