From ae19b1fecbbcf7df21ad6117416306f4d3b3f52a Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Tue, 7 May 2024 15:55:57 +0800 Subject: [PATCH] emit heartbeat chunk before dtaa chunk Signed-off-by: Richard Chien --- src/connector/src/parser/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/connector/src/parser/mod.rs b/src/connector/src/parser/mod.rs index afdd07716634e..1ab32a634763c 100644 --- a/src/connector/src/parser/mod.rs +++ b/src/connector/src/parser/mod.rs @@ -768,6 +768,11 @@ async fn into_chunk_stream(mut parser: P, data_stream current_transaction = None; if last_batch_not_yielded { + // Have to yield heartbeats before data. + if !heartbeat_builder.is_empty() { + yield heartbeat_builder.take(0); + } + yield builder.take(batch_len - (i + 1)); last_batch_not_yielded = false; }