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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17712855#comment-17712855 ] 

GridGain Integration commented on SPARK-43099:
----------------------------------------------

User 'alexjinghn' has created a pull request for this issue:
https://github.com/apache/spark/pull/40747

> `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
>            Priority: Major
>
> 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