IvanFroehlich commented on issue #26465:
URL: https://github.com/apache/beam/issues/26465#issuecomment-2039863167
No, thats the issue. we have tried following meanwhile:
**v2**: replace the latest globally with custom combine function
...
.apply(Combine.globally(new CombineSerializableFunction())
.apply(View.asSingleton());
...
static class CombineSerializableFunction implements
SerializableFunction<Iterable<SideInputDestinations>,
SideInputDestinations> {
@Override
public @UnknownKeyFor @Nullable @Initialized SideInputDestinations apply(
Iterable<SideInputDestinations> input) {
SideInputDestinations last = null;
Iterator<SideInputDestinations> iterator = input.iterator();
while (iterator.hasNext()) {
last = iterator.next();
log.info("SideInput: processing iteration for object {}",
last.hashCode());
}
return last;
}
}
**=> same Exception**
**v3:** replace the View.asSingleton() with asSingletonView():
...
.apply(Combine.globally(new
CombineSerializableFunction()).asSingletonView());
...
static class CombineSerializableFunction implements
SerializableFunction<Iterable<SideInputDestinations>,
SideInputDestinations> {
@Override
public @UnknownKeyFor @Nullable @Initialized SideInputDestinations apply(
Iterable<SideInputDestinations> input) {
SideInputDestinations last = null;
Iterator<SideInputDestinations> iterator = input.iterator();
while (iterator.hasNext()) {
last = iterator.next();
log.info("SideInput: processing iteration for object {}",
last.hashCode());
}
return last;
}
}
=> same Exception in using ParDo:
Caused by: java.lang.IllegalArgumentException: PCollection with
more than one element accessed as a singleton view.
Should we try another version?
Kind Regards,
Ivan
--
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]