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

Let Java and Scala Type Extraction go through the same stack

    XMLWordPrintableJSON

Details

    Description

      Currently, the Java and Scala Type Extraction stacks are completely different.

      • Java uses the TypeExtractor
      • Scala uses the type extraction macros.

      As a result, the same class can be extracted as different types in the different stacks, which can lead to very confusing results. In particular, when you use the TypeExtractor on Scala Classes, you always get a GenericType.

      Suggestion for New Design

      There should be one type extraction stack, based on the TypeExtractor.

      • The TypeExtractor should be extensible and load additions through service loaders, similar as it currently loads Avro as an extension.
      • The Scala Type Extraction logic should be such an extension.
      • The Scala Marcos would only capture the Type (as in Java type), meaning Class, or ParameterizedType, or Array (etc.) and delegate this to the TypeExtractor.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sewen Stephan Ewen
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated: