[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539687#comment-16539687 ] ASF GitHub Bot commented on FLINK-9470: --- Github user aljoscha closed the pull request at: https://github.com/apache/flink/pull/6097 > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Labels: pull-request-available > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16495069#comment-16495069 ] ASF GitHub Bot commented on FLINK-9470: --- Github user aljoscha commented on the issue: https://github.com/apache/flink/pull/6097 `ProcessWindowFunction` has a `key` parameter already. > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494942#comment-16494942 ] ASF GitHub Bot commented on FLINK-9470: --- Github user aljoscha commented on the issue: https://github.com/apache/flink/pull/6097 @kl0u I addressed your comments, PTAL. 😄 > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494025#comment-16494025 ] ASF GitHub Bot commented on FLINK-9470: --- Github user alpinegizmo commented on the issue: https://github.com/apache/flink/pull/6097 +1 Nice! > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493943#comment-16493943 ] ASF GitHub Bot commented on FLINK-9470: --- Github user bowenli86 commented on the issue: https://github.com/apache/flink/pull/6097 +1. I might forget to add the interfaces back then, would be good to have them > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493668#comment-16493668 ] ASF GitHub Bot commented on FLINK-9470: --- Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/6097#discussion_r191460728 --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/KeyedProcessOperatorTest.java --- @@ -50,6 +52,30 @@ @Rule public ExpectedException expectedException = ExpectedException.none(); + @Test + public void testKeyQuerying() throws Exception { + + KeyedProcessOperator, String> operator = + new KeyedProcessOperator<>(new KeyQueryingProcessFunction()); + + OneInputStreamOperatorTestHarness, String> testHarness = + new KeyedOneInputStreamOperatorTestHarness<>(operator, (in) -> in.f0 , BasicTypeInfo.INT_TYPE_INFO); + --- End diff -- same here. > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493667#comment-16493667 ] ASF GitHub Bot commented on FLINK-9470: --- Github user kl0u commented on a diff in the pull request: https://github.com/apache/flink/pull/6097#discussion_r191460316 --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/api/operators/KeyedProcessOperatorTest.java --- @@ -50,6 +52,30 @@ @Rule public ExpectedException expectedException = ExpectedException.none(); + @Test + public void testKeyQuerying() throws Exception { + + KeyedProcessOperator, String> operator = --- End diff -- The `OneInputStreamOperatorTestHarness` is `AutoCloseable` so I would recommend to go with ``` try(harness=...) { ... } ``` And remove the explicit call to `harness.close()`. This is a nice practice to start enforcing in new tests as it cleans up any leaks in case of exceptions and stuff. > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (FLINK-9470) Allow querying the key in KeyedProcessFunction
[ https://issues.apache.org/jira/browse/FLINK-9470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493633#comment-16493633 ] ASF GitHub Bot commented on FLINK-9470: --- GitHub user aljoscha opened a pull request: https://github.com/apache/flink/pull/6097 [FLINK-9470] Allow querying the key in KeyedProcessFunction R: @kl0u @zentol You can merge this pull request into a Git repository by running: $ git pull https://github.com/aljoscha/flink jira-9470-keyedprocessfunction-key Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/6097.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 #6097 commit 0d3cccd546e782113a843df099fd5d8fe1880933 Author: Aljoscha Krettek Date: 2018-05-29T14:46:19Z [FLINK-9470] Allow querying the key in KeyedProcessFunction > Allow querying the key in KeyedProcessFunction > -- > > Key: FLINK-9470 > URL: https://issues.apache.org/jira/browse/FLINK-9470 > Project: Flink > Issue Type: Improvement > Components: DataStream API >Reporter: Aljoscha Krettek >Assignee: Aljoscha Krettek >Priority: Major > Fix For: 1.6.0 > > > {{KeyedProcessFunction.OnTimerContext}} allows querying the key of the firing > timer while {{KeyedProcessFunction.Context}} does not allow querying the key > of the event we're currently processing. -- This message was sent by Atlassian JIRA (v7.6.3#76005)