flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aljoscha Krettek (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-1511) Scala classes not identified as Pojos
Date Wed, 11 Feb 2015 10:08:11 GMT

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

Aljoscha Krettek commented on FLINK-1511:
-----------------------------------------

>From the flink documentation:

Conditions for a class to be treated as a POJO by Flink:
- The class must be public
- It must have a public constructor without arguments
- All fields either have to be public or there must be getters and setters for all non-public
fields.

In your example, the constructor without arguments is missing. This works:

{code}
class WC(var word: String, var cnt: Int) {
  def this() = this("", 0)
  // my logic
}
{code}


> Scala classes not identified as Pojos
> -------------------------------------
>
>                 Key: FLINK-1511
>                 URL: https://issues.apache.org/jira/browse/FLINK-1511
>             Project: Flink
>          Issue Type: Bug
>          Components: Scala API
>    Affects Versions: 0.9
>            Reporter: Fabian Hueske
>            Assignee: Aljoscha Krettek
>
> Regular Scala classes such as 
> {code}
> class WC(var word: String, var cnt: Int) {
>   // my logic
> }
> {code}
> are not identified as POJO data types.
> Scala handles {{var}} class constructor parameters (such as {{word}} and {{cnt}}) as
public and generates getters and setters for them.



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

Mime
View raw message