You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2023/04/17 03:23:00 UTC

[jira] [Assigned] (SPARK-43099) `Class.getCanonicalName` return null for anonymous class on JDK15+, impacting function registry

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

Wenchen Fan reassigned SPARK-43099:
-----------------------------------

    Assignee: Alex Jing

> `Class.getCanonicalName` return null for anonymous class on JDK15+, impacting function registry
> -----------------------------------------------------------------------------------------------
>
>                 Key: SPARK-43099
>                 URL: https://issues.apache.org/jira/browse/SPARK-43099
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 3.4.0
>            Reporter: Alex Jing
>            Assignee: Alex Jing
>            Priority: Major
>             Fix For: 3.5.0
>
>
> On JDK15+, lambda and method references are implemented using hidden classes ([https://openjdk.org/jeps/371)] According to the JEP, 
> {quote}{{Class::getCanonicalName}} returns {{{}null{}}}, indicating the hidden class has no canonical name. (Note that the {{Class}} object for an anonymous class in the Java language has the same behavior.)
> {quote}
> This means [https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala#L53] will always be null.
>  
> This can be fixed by replacing `getCanonicalName` with `getName`
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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