You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Nagaraja Tantry (Jira)" <ji...@apache.org> on 2021/09/17 13:38:00 UTC
[jira] [Commented] (BEAM-11005) Can't use side inputs with
Combine.PerKeyWithHotKeyFanout
[ https://issues.apache.org/jira/browse/BEAM-11005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17416692#comment-17416692 ]
Nagaraja Tantry commented on BEAM-11005:
----------------------------------------
I am running into a similar issue.
I get this error when i use withSideinput and withHotKeyFanOut together.
{code:java}
Caused by: java.lang.IllegalArgumentException: cannot call NullSideInputReader.get()Caused by: java.lang.IllegalArgumentException: cannot call NullSideInputReader.get() at org.apache.beam.runners.core.NullSideInputReader.get(NullSideInputReader.java:48) at org.apache.beam.runners.core.ReduceFnContextFactory$1.sideInput(ReduceFnContextFactory.java:540) at org.apache.beam.sdk.util.CombineContextFactory$2.sideInput(CombineContextFactory.java:58) at com.foo.CombineByKeyFnCustom.addInput(CombineByKeyFnCustom.java:37)
{code}
In the addInput method of CombineByKeyFnCustom i have this code
{code:java}
public class CombineByKeyFnCustom extends CombineWithContext.CombineFnWithContext<Input, Accum, Output> {
@Override public CIMODLAccum addInput(Accum accumulator, Input input, CombineWithContext.Context c) { CustomSideInput customSideInput = c.sideInput(this.customSideInput);
}
{code}
> Can't use side inputs with Combine.PerKeyWithHotKeyFanout
> ---------------------------------------------------------
>
> Key: BEAM-11005
> URL: https://issues.apache.org/jira/browse/BEAM-11005
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Mia Gil Epner
> Priority: P3
> Labels: Clarified, starter
>
> PerKeyWithHotKeyFanout doesn't allow a user to specify a side input and access it in the CombineFn. When the function `withHotKeyFanout` is called, any sideinputs stored in the Combine.PerKey are dropped. ([https://github.com/apache/beam/blob/master/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java#L1571]):
> {code:java}
> public PerKeyWithHotKeyFanout<K, InputT, OutputT> withHotKeyFanout(
> SerializableFunction<? super K, Integer> hotKeyFanout) {
> return new PerKeyWithHotKeyFanout<>(fn, fnDisplayData, hotKeyFanout);
> }
> {code}
> We would like to be able to use side inputs and hot key fanout.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)