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

ASF GitHub Bot commented on BEAM-1149:
--------------------------------------

GitHub user kennknowles opened a pull request:

    https://github.com/apache/incubator-beam/pull/1619

    [BEAM-1149] Cherry pick some fixes to release-0.4.0

    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [x] Make sure the PR title is formatted like:
       `[BEAM-<Jira issue #>] Description of pull request`
     - [x] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [x] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [x] If this contribution is large, please file an Apache
           [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---
    
    This fixes the remaining failures in [BEAM-1149](). I have confirmed `mvn 
clean verify` and the Spark runner's local runnable-on-service tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kennknowles/incubator-beam cherry-picks

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/1619.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 #1619
    
----
commit 122f05131c803ecaa082dfbc9ad6876b0ca467b8
Author: Kenneth Knowles <k...@google.com>
Date:   2016-12-14T19:26:27Z

    SimpleDoFnRunner observes window if SideInputReader is nonempty

commit d9f24b86c644ea85fd197eaab4c2d16b20a70d5f
Author: Kenneth Knowles <k...@google.com>
Date:   2016-12-14T21:12:43Z

    Fix NPE in StatefulParDoEvaluatorFactoryTest mocking

----


> Side input access fails in direct runner (possibly others too) when input 
> element in multiple windows
> -----------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-1149
>                 URL: https://issues.apache.org/jira/browse/BEAM-1149
>             Project: Beam
>          Issue Type: Bug
>            Reporter: Eugene Kirpichov
>            Assignee: Kenneth Knowles
>            Priority: Blocker
>             Fix For: 0.4.0-incubating
>
>
> {code:java}
>   private static class FnWithSideInputs extends DoFn<String, String> {
>     private final PCollectionView<Integer> view;
>     private FnWithSideInputs(PCollectionView<Integer> view) {
>       this.view = view;
>     }
>     @ProcessElement
>     public void processElement(ProcessContext c) {
>       c.output(c.element() + ":" + c.sideInput(view));
>     }
>   }
>   @Test
>   public void testSideInputsWithMultipleWindows() {
>     Pipeline p = TestPipeline.create();
>     MutableDateTime mutableNow = Instant.now().toMutableDateTime();
>     mutableNow.setMillisOfSecond(0);
>     Instant now = mutableNow.toInstant();
>     SlidingWindows windowFn =
>         
> SlidingWindows.of(Duration.standardSeconds(5)).every(Duration.standardSeconds(1));
>     PCollectionView<Integer> view = 
> p.apply(Create.of(1)).apply(View.<Integer>asSingleton());
>     PCollection<String> res =
>         p.apply(Create.timestamped(TimestampedValue.of("a", now)))
>             .apply(Window.<String>into(windowFn))
>             .apply(ParDo.of(new FnWithSideInputs(view)).withSideInputs(view));
>     PAssert.that(res).containsInAnyOrder("a:1");
>     p.run();
>   }
> {code}
> This fails with the following exception:
> {code}
> org.apache.beam.sdk.Pipeline$PipelineExecutionException: 
> java.lang.IllegalStateException: sideInput called when main input element is 
> in multiple windows
>       at 
> org.apache.beam.runners.direct.DirectRunner.run(DirectRunner.java:343)
>       at org.apache.beam.runners.direct.DirectRunner.run(DirectRunner.java:1)
>       at org.apache.beam.sdk.Pipeline.run(Pipeline.java:176)
>       at org.apache.beam.sdk.testing.TestPipeline.run(TestPipeline.java:112)
>       at ....
> Caused by: java.lang.IllegalStateException: sideInput called when main input 
> element is in multiple windows
>       at 
> org.apache.beam.runners.core.SimpleDoFnRunner$DoFnProcessContext.sideInput(SimpleDoFnRunner.java:514)
>       at 
> org.apache.beam.sdk.transforms.ParDoTest$FnWithSideInputs.processElement(ParDoTest.java:738)
> {code}



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

Reply via email to