Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Source plugin to support batch ingestion #2237

Open
manikandan-harman opened this issue Sep 5, 2023 · 2 comments
Open

SQL Source plugin to support batch ingestion #2237

manikandan-harman opened this issue Sep 5, 2023 · 2 comments

Comments

@manikandan-harman
Copy link

Currently, SQL Source Plugin gets the table rows and send it to sink with individual messages. EX. if we get 100 rows from SQL pull and send to REST sink. It's not going that 100 messages to one REST call instead 100 REST calls are happening. We need to have a batch to send it to sink. let's say 50 rows to one REST call and next 50 records into another rest call.

We need to have this for batch processing:

Why is this needed:
To increase the performance and latency.

@ngjaying
Copy link
Collaborator

ngjaying commented Sep 7, 2023

@manikandan-harman Thanks for bring this up. I have some questions about your proposal

  1. The SQL source plugin now designs to fetch data incrementally so the data size return each time may be different. If we support batch send, I would prefer to send out all the data at once instead of count for 50 rows or else. If you need to control the batch size, I would suggest to use the current row-based implementation together with count window. SELECT * FROM yourStream GROUP BY countWindow(50). By this way, your REST sink will receive 50 records at once.
  2. Do you have an idea of the batch send format from the SQL source? For example {data:[{"id":"row1"},{"id":"row2"}]}

@manikandan-harman
Copy link
Author

@ngjaying I could be able to achieve batch capability using SELECT * FROM yourStream GROUP BY countWindow(50).
I made this feature request as per your suggestion in this. #2234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants