Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12300

Unused Import warning with DataStream[Seq[...]]

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.0
    • Fix Version/s: None
    • Component/s: API / Scala
    • Labels:
      None

      Description

      There is a regression in Flink 1.8.0 compared to 1.7.2 using Scala...

      When enabling unused import warnings in build.sbt:

      scalacOptions ++= Seq("-Xfatal-warnings", "-Ywarn-unused-import")
      

      ...and compiling a file with this content:

      package com.example.unusedimportissue
      
      import org.apache.flink.streaming.api.scala._
      
      object ExampleSeqDataStream {
        def doubleElement(numbers: DataStream[Int]): DataStream[Seq[Int]] = {
          numbers.map(x => Seq(x, x))
        }
      }
      

      Then with Flink 1.8.0 this compile issue happens (while with Flink 1.7.2 everything compiles fine):

      [error] /path/to/com/example/unusedimportissue/example.scala:1:0: Unused import
      [error] package com.example.unusedimportissue
      [error] ^
      

      If the result type DataStream[Seq[Int]] is replaced by DataStream[Int], then this issue does not occur, so it is related to the Seq[...] type.

      Maybe a Flink macro is generating an import that is not used, resulting in this error?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hiddenbit Michael
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: