You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Aljoscha Krettek (JIRA)" <ji...@apache.org> on 2017/06/28 13:03:00 UTC

[jira] [Commented] (FLINK-7029) Documentation for WindowFunction is confusing

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

Aljoscha Krettek commented on FLINK-7029:
-----------------------------------------

I actually don't like the variants without an explicit {{KeySelector}} because it's not possible to statically type check these cases (either tuple keys or POJO field keys). Using a {{KeySelector}} makes the key type explicit and also makes it explicit in the {{WindowFunction}}.

As you noticed, the key type is always {{Tuple}} when not using a {{KeySelector}} and I don't see a way of making that type more explicit when only selecting one field.

> Documentation for WindowFunction is confusing
> ---------------------------------------------
>
>                 Key: FLINK-7029
>                 URL: https://issues.apache.org/jira/browse/FLINK-7029
>             Project: Flink
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Felix Neutatz
>            Priority: Trivial
>              Labels: documentation
>
> Hi,
> in the [example of the WindowFunction in the documentation|https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/windows.html#windowfunction---the-generic-case] we use WindowFunction<Tuple<String, Long>, String, String, TimeWindow>. That means that our key data-type is a String. For me, this is highly confusing, since we can only have a String data type for the key, if we implement a custom key selector. Usually people, especially beginners, will use something like keyBy(ID), keyBy("attributeName"), which will always return a tuple e.g. a Tuple1<String>. It would be great if somebody could change this to a tuple key type in  the example. I am sure this might help beginners to understand that by default the key type is a tuple.
> Moreover, another suggestion would be that we overwrite keyBy() in a way that if we just get one attribute, we return this type directly instead of wrapping it in a Tuple1.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)