flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-1458) Interfaces and abstract classes are not valid types
Date Mon, 02 Feb 2015 15:12:34 GMT

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

ASF GitHub Bot commented on FLINK-1458:
---------------------------------------

GitHub user aljoscha opened a pull request:

    https://github.com/apache/flink/pull/357

    [FLINK-1458] Allow Interfaces and abstract types in TypeExtractor

    Kryo already supports them, so it was just a question of the
    TypeExtractor allowing them.
    
    I also added tests for this.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aljoscha/flink interfaces-generic-type-info-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/357.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #357
    
----
commit 6b1733178592c5c47145db165eb9c6797b156e19
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Date:   2015-02-02T15:08:18Z

    [FLINK-1458] Allow Interfaces and abstract types in TypeExtractor
    
    Kryo already supports them, so it was just a question of the
    TypeExtractor allowing them.

----


> Interfaces and abstract classes are not valid types
> ---------------------------------------------------
>
>                 Key: FLINK-1458
>                 URL: https://issues.apache.org/jira/browse/FLINK-1458
>             Project: Flink
>          Issue Type: Bug
>            Reporter: John Sandiford
>            Assignee: Aljoscha Krettek
>
> I don't know whether this is by design or is a bug, but I am having trouble working with
DataSet and traits in scala which is a major limitation.  A simple example is shown below.
 
> Compile time warning is 'Type Main.SimpleTrait has no fields that are visible from Scala
Type analysis. Falling back to Java Type Analysis...'
> Run time error is 'Interfaces and abstract classes are not valid types: interface Main$SimpleTrait'
> Regards, John
>  val env = ExecutionEnvironment.getExecutionEnvironment
>   trait SimpleTrait {
>     def contains(x: String): Boolean
>   }
>   class SimpleClass extends SimpleTrait {
>     def contains(x: String) = true
>   }
>   val data: DataSet[Double] = env.fromElements(1.0, 2.0, 3.0, 4.0)
>   def f(data: DataSet[Double]): DataSet[SimpleTrait] = {
>     data.mapPartition(iterator => {
>       Iterator(new SimpleClass)
>     })
>   }
>   val g = f(data)
>   g.print()
>   env.execute("Simple example")



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message