Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-14729

Multi-topics consuming from KafkaTableSource

    XMLWordPrintableJSON

Details

    • Important

    Description

      Hi, all. I propose a new functionality of KafkaTableSource which can consume multiple topics at the same time. 
      Design plan

      • Add a new constructor in KafkaTableSource which accepts topics with List type as one parameter.
      • Modify the existed one which only accepts one topic as string type to call the proposed one to finish the instantiation. That is to say, wrap this topic in a list and pass it to the multi-topics-consuming constructor.
      • Modify the overridden method createKafkaConsumer in KafkaTableSource to pass topics as List instead of String.
      • Replace the field topic with topics as List type in  KafkaTableSourceBase and modify every place using topic with topics. So we just need to modify the constructor KafkaTableSourceBase, method getDataStream, and equals and hashCode.

      Test plan

      There is less to do as KafkaTableSource is based on FlinkKafkaConsumer which already supports consuming multiple topics and is tested well. Of course, we can easily add further more tests if needed.

       

      So what's your opinion?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              50man Leo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h