Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"calling sideInput() with unknown view" exception even though I'm passing the view?

The code starts like this:

return pcol.apply(ParDo.named("FindTheBug")
        .withSideInputs(foo)
        .withSideInputs(bar(
        .of(new DoFn<T, U>() {
            F myFoo = c.sideInput(foo);
            B myBar = c.sideInput(bar);

These side inputs are declared, why doesn't Dataflow see them?

like image 915
redtuna Avatar asked Sep 17 '25 19:09

redtuna


2 Answers

It turns out that calling withSideInputs more than once is not allowed. The code should instead look like this:

return pcol.apply(ParDo.named("FindTheBug")
        .withSideInputs(foo, bar)
        .of(new DoFn<T, U>() {
            // now you can access both side inputs

The hint is that the function's called "withSideInputs", not "withSideInput". This tripped me more than once and isn't googleable, so I thought I'd write it down in case someone else runs into this!

like image 58
redtuna Avatar answered Sep 19 '25 09:09

redtuna


Also, this error happen when one forgot to call withSideInputs.

like image 38
Paweł Szczur Avatar answered Sep 19 '25 09:09

Paweł Szczur