1

I trying to test the following ParDo handler:

public class DoFnHandlerFn extends DoFn<KV<Row, Row>, Row> {

    @ProcessElement
    public void processElement(@NotNull ProcessContext ctx, @SideInput("si_1") Map<Row, Iterable<Row>> si_1, @SideInput("si_2") List<Row> si_2) {
        var el = ctx.element();
        
    }
}

But I have difficulty creating ProcessContext instance! I tried

var el = new DoFn.ProcessContext();

But I don't allowed to do it with error message: 'org.apache.beam.sdk.transforms.DoFn' is not an enclosing class

How can I instantiate ProcessContext object in order to test it?

0

1 Answer 1

0

Are you using a TestPipeline? I don't think you need to create a ProcessContext.

I think this document might be helpful to clarify some of the concepts: https://beam.apache.org/documentation/pipelines/test-your-pipeline/

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.