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

Allow @TypeInfo annotation on POJO field declarations

    XMLWordPrintableJSON

Details

    • @TypeInfo annotations can now also be used on POJO fields which, for example, can help to define custom serializers for third-party classes that can otherwise not be annotated themselves.

    Description

      The TypeInfo annotation is a great way to declare serializers for custom types however I feel that it's usage is limited by the fact that it can only be used on types that are declared in the project.

      By allowing the annotation to be used on field declarations we could improve the TypeExtractor logic to use the type factory when creating the PojoTypeInformation.

      This would be a big improvement as in many cases classes from other libraries or collection types are used within custom Pojo classes and Flink would default to Kryo serialization which would hurt performance and cause problems later.

      The current workaround in these cases is to implement a custom serializer for the entire pojo which is a waste of effort when only a few fields might require custom serialization logic.

      Attachments

        Issue Links

          Activity

            People

              nkruber Nico Kruber
              gyfora Gyula Fora
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m