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

[jira] [Commented] (SPARK-45627) Fix `symbol literal is deprecated`

    [ https://issues.apache.org/jira/browse/SPARK-45627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17778439#comment-17778439 ] 

Yang Jie commented on SPARK-45627:
----------------------------------

Although it seems we can work around by introducing `language.deprecated.symbolLiterals`, I'm not sure whether it will lead to too many files having to distinguish Scala versions during the parallel period of Scala 2.13 and Scala 3 ... 

 
Besides biting the bullet and fixing them, I'm not certain if there's a more elegant way to handle this issue and would like to hear your suggestions.
 
[~srowen] [~dongjoon] [HyukjinKwon|https://github.com/HyukjinKwon] [~sarutak] [~mgrigorov] 

> Fix `symbol literal is deprecated`
> ----------------------------------
>
>                 Key: SPARK-45627
>                 URL: https://issues.apache.org/jira/browse/SPARK-45627
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Connect, GraphX, MLlib, Spark Core, SQL
>    Affects Versions: 4.0.0
>            Reporter: Yang Jie
>            Priority: Major
>
> For the code `val symbol = 'symbol`, it's a compile warning in Scala 2.13, but it's a compile error in Scala 3.
>  - Scala 2.13 
>  
> {code:java}
> Welcome to Scala 2.13.12 (OpenJDK 64-Bit Server VM, Java 17.0.8).
> Type in expressions for evaluation. Or try :help.
> scala> val symbol = 'symbol
>                     ^
>        warning: symbol literal is deprecated; use Symbol("symbol") instead [quickfixable]
> val symbol: Symbol = Symbol(symbol) {code}
>  
>  
>  * Scala 3
>  
> {code:java}
> Welcome to Scala 3.3.1 (17.0.8, Java OpenJDK 64-Bit Server VM).
> Type in expressions for evaluation. Or try :help.
>                                                                                                                                                                                                                                                     
> scala> val symbol = 'symbol
> -- Error: ----------------------------------------------------------------------
> 1 |val symbol = 'symbol
>   |             ^
>   |symbol literal 'symbol is no longer supported,
>   |use a string literal "symbol" or an application Symbol("symbol") instead,
>   |or enclose in braces '{symbol} if you want a quoted expression.
>   |For now, you can also `import language.deprecated.symbolLiterals` to accept
>   |the idiom, but this possibility might no longer be available in the future. {code}
>  



--
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