flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Saputra (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-1654) Wrong scala example of POJO type in documentation
Date Thu, 05 Mar 2015 02:44:38 GMT

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

Henry Saputra commented on FLINK-1654:
--------------------------------------

scala> case class Foo(val bar: Int)
defined class Foo

scala> val test = Foo(2)
test: Foo = Foo(2)

scala> test.bar
res0: Int = 2

scala> 

> Wrong scala example of POJO type in documentation
> -------------------------------------------------
>
>                 Key: FLINK-1654
>                 URL: https://issues.apache.org/jira/browse/FLINK-1654
>             Project: Flink
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 0.9
>            Reporter: Chiwan Park
>            Priority: Trivial
>
> In [documentation|https://github.com/chiwanpark/flink/blob/master/docs/programming_guide.md#pojos],
there is a scala example of POJO
> {code}
> class WordWithCount(val word: String, val count: Int) {
>   def this() {
>     this(null, -1)
>   }
> }
> {code}
> I think that this is wrong because Flink POJO required public fields or private fields
with getter and setter. Fields in scala class is private in default. We should change the
field declarations to use `var` keyword or class declaration to case class.



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

Mime
View raw message