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

Scala StreamExecutionEnvironment.createInput should pass on the TypeInfo

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4.0
    • 1.5.0
    • API / Scala
    • None

    Description

      This is StreamExecutionEnvironment.createInput in the Scala API:

      def createInput[T: TypeInformation](inputFormat: InputFormat[T, _]): DataStream[T] =
        asScalaStream(javaEnv.createInput(inputFormat))
      

      It should pass on the implicitly got TypeInformation to Java like this:

      def createInput[T: TypeInformation](inputFormat: InputFormat[T, _]): DataStream[T] =
        asScalaStream(javaEnv.createInput(inputFormat, implicitly[TypeInformation[T]]))
      

      The current situation creates a problem, for example, when we have generics in the type like in the following code, where the Java API can't deduce the TypeInformation on its own:

       StreamExecutionEnvironment.getExecutionEnvironment.createInput[Tuple2[Integer, Integer]](new ParallelIteratorInputFormat[Tuple2[Integer, Integer]](null))
      

      Attachments

        Issue Links

          Activity

            People

              ggevay Gábor Gévay
              ggevay Gábor Gévay
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: