damccorm opened a new issue, #20301:
URL: https://github.com/apache/beam/issues/20301
Unable to use ApproximateQuantiles.globally or ApproximateUnique.globally
with input windowed not using GlobalWindows.
To make it run we need to set either
```
.withoutDefaults()
```
or
```
.asSingletonView()
```
Currently we can't call any of the above on
ApproximateQuantiles.globally()/ApproximateUnique.globally as it does not
return underlying Combine.globally, but PTransform or Globally<T\> in case of
ApproximateUnique.
Example failing case:
```
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));
```
It throws expected error from internal Combine.globally() transform:
```
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.
```
Imported from Jira
[BEAM-10005](https://issues.apache.org/jira/browse/BEAM-10005). Original Jira
may contain additional context.
Reported by: darshanjani.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]