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

Serializer for collection of Scala case classes are generated with different anonymous class names in 1.3

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      In the Scala API, serializers are generated using Scala macros (via the org.apache.flink.streaming.api.scala.createTypeInformation(..) util).
      The generated serializers are inner anonymous classes, therefore classnames will differ depending on when / order that the serializers are generated.

      From 1.1 / 1.2 to Flink 1.3, the generated classnames for a serializer for a collections of case classes (e.g. List[SomeUserCaseClass]) will be different. In other words, the exact same user code written in the Scala API, compiling it with 1.1 / 1.2 and with 1.3 will result in different classnames.

      This is problematic for restoring older savepoints that have Scala case class collections in their state, because the old serializer cannot be recovered (due to the generated classname change).

      For now, I've managed to identify that the root cause for this is that in 1.3 the TypeSerializer base class additionally extends the TypeDeserializer interface. Removing this extending resolves the problem. The actual reason for why this affects the generated classname is still being investigated.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tzulitai Tzu-Li (Gordon) Tai
            tzulitai Tzu-Li (Gordon) Tai
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment