Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-38620

Replace `value.formatted(formatString)` with `formatString.format(value)` to clean up compilation warning

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • SQL
    • None

    Description

      There are compile warnings as follows:

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

      Attachments

        Activity

          People

            LuciferYang Yang Jie
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: