You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/03/22 03:13:00 UTC

[jira] [Commented] (SPARK-38620) Replace `value.formatted(formatString)` with `formatString.format(value)` to clean up compilation warning

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

Apache Spark commented on SPARK-38620:
--------------------------------------

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

> Replace `value.formatted(formatString)` with `formatString.format(value)` to clean up compilation warning
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-38620
>                 URL: https://issues.apache.org/jira/browse/SPARK-38620
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Yang Jie
>            Priority: Minor
>
> There are compile warnings as follows:
> {code:java}
> [WARNING] /spark-source/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala:67: [deprecation @ org.apache.spark.streaming.ui.RecordRateUIData.formattedAvg.$anonfun | origin=scala.Predef.StringFormat.formatted | version=2.12.16] method formatted in class StringFormat is deprecated (since 2.12.16): Use `formatString.format(value)` instead of `value.formatted(formatString)`,
> or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.
> [WARNING] /spark-source/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPage.scala:201: [deprecation @ org.apache.spark.sql.streaming.ui.StreamingQueryPagedTable.row | origin=scala.Predef.StringFormat.formatted | version=2.12.16] method formatted in class StringFormat is deprecated (since 2.12.16): Use `formatString.format(value)` instead of `value.formatted(formatString)`,
> or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.
> [WARNING] /spark-source/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPage.scala:202: [deprecation @ org.apache.spark.sql.streaming.ui.StreamingQueryPagedTable.row | origin=scala.Predef.StringFormat.formatted | version=2.12.16] method formatted in class StringFormat is deprecated (since 2.12.16): Use `formatString.format(value)` instead of `value.formatted(formatString)`,
> or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters. {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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