You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Russell Spitzer (Jira)" <ji...@apache.org> on 2021/10/19 19:40:00 UTC

[jira] [Updated] (SPARK-37061) Custom V2 Metrics uses wrong classname for lookup

     [ https://issues.apache.org/jira/browse/SPARK-37061?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Russell Spitzer updated SPARK-37061:
------------------------------------
    Summary: Custom V2 Metrics uses wrong classname for lookup  (was: Custom V2 Metrics uses wrong classname in for lookup)

> Custom V2 Metrics uses wrong classname for lookup
> -------------------------------------------------
>
>                 Key: SPARK-37061
>                 URL: https://issues.apache.org/jira/browse/SPARK-37061
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.2.0
>            Reporter: Russell Spitzer
>            Priority: Minor
>
> Currently CustomMetrics uses `getCanonicalName` to get the metric type name
> https://github.com/apache/spark/blob/38493401d18d42a6cb176bf515536af97ba1338b/sql/core/src/main/scala/org/apache/spark/sql/execution/metric/CustomMetrics.scala#L31-L33
> But when using reflection we need to use the original type name.
> Here is an example when working with an inner class
> ```
> Class.getName = org.apache.iceberg.spark.source.SparkBatchScan$FilesScannedMetric
> Class.getCanonicalName =
> org.apache.iceberg.spark.source.SparkBatchScan.FilesScannedMetric
> ```
> The "$" name is required to look up this class while the "." version will fail with CNF.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org