[ 
https://issues.apache.org/jira/browse/BEAM-10005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Darshan Jani updated BEAM-10005:
--------------------------------
    Description: 
Unable to use ApproximateQuantiles.globally or ApproximateQuantiles.globally 
with input windowed not using GlobalWindows.
To make it run we need to set either 
{code:java}
.withoutDefaults()
{code}
or
{code:java}
.asSingletonView()
{code}

Currently we can't call any of the above on ApproximateQuantiles.globally() as 
it does not return underlying Combine.globally, but PTransform.

Example failing case:

{code:java}
PCollection<Long> elements = p.apply(GenerateSequence.from(0).to(100)
              .withRate(1,Duration.millis(1)).withTimestampFn(Instant::new));

      PCollection<List<Long>> input = elements
              
.apply(Window.into(SlidingWindows.of(Duration.millis(3)).every(Duration.millis(1))))
              .apply(ApproximateQuantiles.globally(17));
{code}

It throws expected error from internal Combine.globally() transform:

{code:java}
Default values are not supported in Combine.globally() if the input 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.
{code}


  was:
Unable to use ApproximateQuantiles.globally with input windowed not using 
GlobalWindows.
To make it run we need to set either 
{code:java}
.withoutDefaults()
{code}
or
{code:java}
.asSingletonView()
{code}

Currently we can't call any of the above on ApproximateQuantiles.globally() as 
it does not return underlying Combine.globally, but PTransform.

Example failing case:

{code:java}
PCollection<Long> elements = p.apply(GenerateSequence.from(0).to(100)
              .withRate(1,Duration.millis(1)).withTimestampFn(Instant::new));

      PCollection<List<Long>> input = elements
              
.apply(Window.into(SlidingWindows.of(Duration.millis(3)).every(Duration.millis(1))))
              .apply(ApproximateQuantiles.globally(17));
{code}

It throws expected error from internal Combine.globally() transform:

{code:java}
Default values are not supported in Combine.globally() if the input 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.
{code}



> Unable to use ApproximateQuantiles.globally/ApproximateUniques.globally when 
> inputs not windowed by GlobalWindows
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-10005
>                 URL: https://issues.apache.org/jira/browse/BEAM-10005
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 2.20.0
>            Reporter: Darshan Jani
>            Assignee: Darshan Jani
>            Priority: Major
>
> Unable to use ApproximateQuantiles.globally or ApproximateQuantiles.globally 
> with input windowed not using GlobalWindows.
> To make it run we need to set either 
> {code:java}
> .withoutDefaults()
> {code}
> or
> {code:java}
> .asSingletonView()
> {code}
> Currently we can't call any of the above on ApproximateQuantiles.globally() 
> as it does not return underlying Combine.globally, but PTransform.
> Example failing case:
> {code:java}
> PCollection<Long> elements = p.apply(GenerateSequence.from(0).to(100)
>               .withRate(1,Duration.millis(1)).withTimestampFn(Instant::new));
>       PCollection<List<Long>> input = elements
>               
> .apply(Window.into(SlidingWindows.of(Duration.millis(3)).every(Duration.millis(1))))
>               .apply(ApproximateQuantiles.globally(17));
> {code}
> It throws expected error from internal Combine.globally() transform:
> {code:java}
> Default values are not supported in Combine.globally() if the input 
> 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.
> {code}



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

Reply via email to