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

Added ResultTypeQueryable interface to TypeSerializerInputFormat.

    XMLWordPrintableJSON

Details

    Description

      It is currently impossible to use the TypeSerializerInputFormat with generic Tuple types.

      For example, this example gist fails with a

      Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: The type returned by the input format could not be automatically determined. Please specify the TypeInformation of the produced type explicitly.
      at org.apache.flink.api.java.ExecutionEnvironment.readFile(ExecutionEnvironment.java:341)
      at SerializedFormatExample$.main(SerializedFormatExample.scala:48)
      at SerializedFormatExample.main(SerializedFormatExample.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

      exaception.

      To fix the issue, I changed the constructor to take a TypeInformation<T> instad of a TypeSerializer<T> argument. If this is indeed a bug, I think that this is a good solution.

      Unfortunately the fix breaks the API. Feel free to change it if you find a more elegant solution compatible with the 0.8 branch.

      The suggested fix can be found in the GitHub PR#349.

      Attachments

        Activity

          People

            aalexandrov Alexander Alexandrov
            aalexandrov Alexander Alexandrov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 6h
                6h
                Remaining:
                Remaining Estimate - 6h
                6h
                Logged:
                Time Spent - Not Specified
                Not Specified