Is it possible to filter a stream using a table? For every event that comes in from the data stream I want to query a table and execute some logic such as filter/enrich/etc and pass the event down the pipeline. How would I go about doing this?
a
Alex Stuart
07/25/2023, 2:59 PM
In this example, do you mean something like “`publish events only when CREDIT_SCORE>400`” where
CREDIT_SCORE
is recorded in a Flink Table?
s
Saleh
07/25/2023, 6:00 PM
Exactly, the credit score is coming from a change log type Kafka topic. What do you recommend using for this case?
While I was looking into the subject I found that in this video
https://youtu.be/cJS18iKLUIY?t=2276▾
(99 Ways to Enrich Streaming Data with Apache Flink), he talks about keying the two streams, connecting them then finally using a stateful CoProcessFunction.
For my use case, I don't really need a versioned credit score table and I don't care about time accuracy. My events are either published or they aren't and that's not critical to the system.
Would you still recommend a Table API Temporal join knowing this? If I were to use the Table API, I would need to convert the event stream to a table. Does that mean Flink is keeping a state of all events it has seen even when I don't need it for my use case?