Unit test Flink job using DeltaSource & DeltaSink #3879
Unanswered
Timelessprod
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm quite new to Flink and I try to build a simple project which reads Delta tables, do some processing using Flink and then stores the output to (other) Delta tables. To make things clean I want to unit test all (or most) of the function I write, including the Flink jobs.
As I use Delta, sourcea of my jobs are
DeltaSource
s and sinks areDeltaSink
s. However to run unit tests I need to be able to inject custom data in the jobs and check the output to see if it matches what I expect. As the documentation doesn't state how to achieve that either on the Flink documentation and Delta documentation, I tried to do things myself. I defined the sink below to collect the job outputs and use thefromElements()
method as a source to inject data. The problem I have now is thatDeltaSink
doesn't extends or implements the FlinkSink
interface thus I cannot swap aDeltaSink
for aCollectSink
in my jobs without getting typing errors. Same goes for theDeltaSource
when I try to usefromElements()
.Is there a proper way to do unit test when using the Delta connector with Flink ? If so where am I supposed to find documentation as it is not written in this repo nor on delta.io website ?
Thank you.
PS: Any up-to-date (Flink 1.20 ideally or 1.19) documentation and/or sample project about Flink and/or Delta Flink Connector is welcome :) Those are very hard to find online which makes starting a project difficult.
Beta Was this translation helpful? Give feedback.
All reactions