[ 
https://issues.apache.org/jira/browse/BEAM-6855?focusedWorklogId=320628&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-320628
 ]

ASF GitHub Bot logged work on BEAM-6855:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Sep/19 16:23
            Start Date: 30/Sep/19 16:23
    Worklog Time Spent: 10m 
      Work Description: salmanVD commented on pull request #9612: [BEAM-6855] 
Side inputs are not supported when using the state API
URL: https://github.com/apache/beam/pull/9612#discussion_r329669185
 
 

 ##########
 File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java
 ##########
 @@ -2294,6 +2294,47 @@ public void processElement(
           .containsInAnyOrder(Lists.newArrayList(12, 42, 84, 97), 
Lists.newArrayList(0, 1, 2));
       pipeline.run();
     }
+
+    @Test
+    @Category({ValidatesRunner.class, UsesStatefulParDo.class, 
UsesSideInputs.class})
+    public void testStateSideInput() {
+      final PCollectionView<Integer> sideInput =
+          pipeline
+              .apply("CreateSideInput1", Create.of(2))
+              .apply("ViewSideInput1", View.asSingleton());
+
+      TestSimpleStatefulDoFn fn = new TestSimpleStatefulDoFn(sideInput);
+      pipeline.apply(Create.of(KV.of(1, 
2))).apply(ParDo.of(fn).withSideInputs(sideInput));
+
+      pipeline.run();
+    }
+
+    private static class TestSimpleStatefulDoFn extends DoFn<KV<Integer, 
Integer>, Integer> {
+
+      private final PCollectionView<Integer> view;
+
+      @StateId("foo")
+      private final StateSpec<ValueState<Integer>> spec = 
StateSpecs.value(VarIntCoder.of());
+
+      private TestSimpleStatefulDoFn(PCollectionView<Integer> view) {
+        this.view = view;
+      }
+
+      @ProcessElement
+      public void processElem(ProcessContext c) {
+        // noop
 
 Review comment:
   Done.  Somehow python precommit is failing, not related to this tests though 
I believe
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 320628)
    Time Spent: 5h 50m  (was: 5h 40m)

> Side inputs are not supported when using the state API
> ------------------------------------------------------
>
>                 Key: BEAM-6855
>                 URL: https://issues.apache.org/jira/browse/BEAM-6855
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-core, runner-dataflow, runner-direct
>            Reporter: Reuven Lax
>            Assignee: Shehzaad Nakhoda
>            Priority: Major
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to