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 <gi...@git.apache.org> on 2018/05/29 14:48:05 UTC

[GitHub] flink pull request #6097: [FLINK-9470] Allow querying the key in KeyedProces...

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 <al...@...>
Date:   2018-05-29T14:46:19Z

    [FLINK-9470] Allow querying the key in KeyedProcessFunction

----


---

[GitHub] flink issue #6097: [FLINK-9470] Allow querying the key in KeyedProcessFuncti...

Posted by bowenli86 <gi...@git.apache.org>.
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


---

[GitHub] flink pull request #6097: [FLINK-9470] Allow querying the key in KeyedProces...

Posted by kl0u <gi...@git.apache.org>.
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<Integer, Tuple2<Integer, String>, String> operator =
    +			new KeyedProcessOperator<>(new KeyQueryingProcessFunction());
    +
    +		OneInputStreamOperatorTestHarness<Tuple2<Integer, String>, String> testHarness =
    +			new KeyedOneInputStreamOperatorTestHarness<>(operator, (in) -> in.f0 , BasicTypeInfo.INT_TYPE_INFO);
    +
    --- End diff --
    
    same here.


---

[GitHub] flink pull request #6097: [FLINK-9470] Allow querying the key in KeyedProces...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha closed the pull request at:

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


---

[GitHub] flink issue #6097: [FLINK-9470] Allow querying the key in KeyedProcessFuncti...

Posted by alpinegizmo <gi...@git.apache.org>.
Github user alpinegizmo commented on the issue:

    https://github.com/apache/flink/pull/6097
  
    +1 Nice!


---

[GitHub] flink issue #6097: [FLINK-9470] Allow querying the key in KeyedProcessFuncti...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on the issue:

    https://github.com/apache/flink/pull/6097
  
    @kl0u I addressed your comments, PTAL. 😄 


---

[GitHub] flink pull request #6097: [FLINK-9470] Allow querying the key in KeyedProces...

Posted by kl0u <gi...@git.apache.org>.
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<Integer, Tuple2<Integer, String>, 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.


---

[GitHub] flink issue #6097: [FLINK-9470] Allow querying the key in KeyedProcessFuncti...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on the issue:

    https://github.com/apache/flink/pull/6097
  
    `ProcessWindowFunction` has a `key` parameter already.


---