wypoon commented on code in PR #4588: URL: https://github.com/apache/iceberg/pull/4588#discussion_r855531401
########## spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/metrics/NumDeletes.java: ########## @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.iceberg.spark.source.metrics; + +import java.text.NumberFormat; +import org.apache.spark.sql.connector.metric.CustomMetric; + +public class NumDeletes implements CustomMetric { Review Comment: I can open a Spark PR to change `CustomSumMetric`, but for now I'd just extend `CustomMetric`. The thing is, Spark instantiates your `CustomMetric` class and using reflection, calls its `aggregateTaskMetrics` method to get the value to display in the UI. However, even if you extend `CustomSumMetric` and don't override `aggregateTaskMetrics`, Spark still needs to instantiate your `CustomMetric` class, so you can't get away from putting your `CustomMetric` class in the classpath of the Spark History Server. If there was a way to just use `CustomSumMetric` (and live with its deficient output formatting) and not have to provide your `CustomMetric` class to the SHS, I'd accept that, but there isn't. Thus I really don't see any benefit to extending `CustomSumMetric`. -- 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]
