You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/04/19 23:16:04 UTC

[jira] [Commented] (BEAM-2019) Count.globally() requires default values for non-GlobalWindows

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

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

GitHub user XuMingmin opened a pull request:

    https://github.com/apache/beam/pull/2603

    [BEAM-2019] Count.globally() requires default values for non-GlobalWindows

    fix below error of Count.globally() when not using `GlobalWindows`:
    ```
    Exception in thread "main" java.lang.IllegalStateException: Default values are not supported in Combine.globally() \
    if the output PCollection is not windowed by GlobalWindows. Instead, use Combine.globally().withoutDefaults() \
    to output an empty PCollection if the input PCollection is empty, or Combine.globally().asSingletonView() \
    to get the default output of the CombineFn if the input PCollection is empty.
    ```

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

    $ git pull https://github.com/XuMingmin/beam BEAM-2019

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

    https://github.com/apache/beam/pull/2603.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 #2603
    
----
commit 9e49ccc67bd7b0e36f8986d896087cc9250dbe13
Author: mingmxu <mi...@ebay.com>
Date:   2017-04-19T23:11:03Z

    Use Combine.globally().withoutDefaults() in Count.globally()

----


> Count.globally() requires default values for non-GlobalWindows
> --------------------------------------------------------------
>
>                 Key: BEAM-2019
>                 URL: https://issues.apache.org/jira/browse/BEAM-2019
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Xu Mingmin
>            Assignee: Xu Mingmin
>            Priority: Minor
>
> Here's my code:
> {code}
> .apply(Window.<String>into(FixedWindows.of(Duration.standardHours(1)))  .triggering(Repeatedly.forever(AfterProcessingTime.pastFirstElementInPane().plusDelayOf(Duration.standardMinutes(1))))
>           .withAllowedLateness(Duration.standardMinutes(10))
>           .accumulatingFiredPanes()
>           )
> .apply(Count.<String>globally());
> {code}
> And the error message as below:
> {code}
> Exception in thread "main" java.lang.IllegalStateException: Default values are not supported in Combine.globally() if the output PCollection is not windowed by GlobalWindows. Instead, use Combine.globally().withoutDefaults() to output an empty PCollection if the input PCollection is empty, or Combine.globally().asSingletonView() to get the default output of the CombineFn if the input PCollection is empty.
> 	at org.apache.beam.sdk.transforms.Combine$Globally.expand(Combine.java:1463)
> 	at org.apache.beam.sdk.transforms.Combine$Globally.expand(Combine.java:1336)
> 	at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:420)
> 	at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:334)
> 	at org.apache.beam.sdk.values.PCollection.apply(PCollection.java:154)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)