Search code examples
apache-flinkapache-kafka-connectflink-sql

What is a better design in Flink Sql


I have a scenario at flink sql data processing which has many kafka message(json format).All of the messages content are similar but not the same. I created many flink tables one to one correspondence to the messages and I realise it is hard to maintance kafka topic.

event1:
{
    "id": "id_001",
    "type": "in",
    "create_time": 1635116133089, 
    "uid":"uid_001"
}
event2:
{
    "id":"id_002",
    "status":"login",
    "type":"in"
}

My flink sqls use watermark、 windows、 cep generally.

My pain point is I have variety of tables seems redundant. Is there a better table design in my case?


Solution

  • My initial thought would be to see if you can define a common schema for your events while using optional fields. You could then post all your events to one topic, since some fields can remain null.