Re: Passing a custom SourceContext to a SourceFunction

2019-05-16 Thread Chesnay Schepler
You cannot control what kind of SourceContext is passed into your function. What are you trying to achieve? On 15/05/2019 09:30, Debasish Ghosh wrote: Hi - I have a custom SourceFunction .. class MySourceFunction[T](data: Seq[T]) extends SourceFunction[T] { def run(ctx: SourceContext[T]): U

Passing a custom SourceContext to a SourceFunction

2019-05-15 Thread Debasish Ghosh
Hi - I have a custom SourceFunction .. class MySourceFunction[T](data: Seq[T]) extends SourceFunction[T] { def run(ctx: SourceContext[T]): Unit = { data.foreach(d ⇒ ctx.collect(d)) } } When this function is run during job execution, the SourceContext that gets passed serializes the data.