You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yun Gao (Jira)" <ji...@apache.org> on 2020/01/21 05:11:00 UTC

[jira] [Commented] (FLINK-15674) Let Java and Scala Type Extraction go through the same stack

    [ https://issues.apache.org/jira/browse/FLINK-15674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17019855#comment-17019855 ] 

Yun Gao commented on FLINK-15674:
---------------------------------

After moving Scala macro type extractor as a service of _TypeExtractor_, I think we should need to choose different services according to the class ? If so, we may need to have some methods to distinguish Scala classes from Java classes.

> Let Java and Scala Type Extraction go through the same stack
> ------------------------------------------------------------
>
>                 Key: FLINK-15674
>                 URL: https://issues.apache.org/jira/browse/FLINK-15674
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / DataStream
>            Reporter: Stephan Ewen
>            Priority: Critical
>              Labels: usability
>
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)