From 9d64ad203d9fb5cf173467561c98a7b9b0a0bff9 Mon Sep 17 00:00:00 2001 From: "zihe.liu" Date: Mon, 13 Nov 2023 21:01:57 +0800 Subject: [PATCH] [Enhancement] Check ready_for_next in has_output (backport #34863) (#34864) Signed-off-by: zihe.liu --- be/src/exec/pipeline/scan/scan_operator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/be/src/exec/pipeline/scan/scan_operator.cpp b/be/src/exec/pipeline/scan/scan_operator.cpp index dc5184111c7ff..a7712272d4f5a 100644 --- a/be/src/exec/pipeline/scan/scan_operator.cpp +++ b/be/src/exec/pipeline/scan/scan_operator.cpp @@ -165,7 +165,10 @@ bool ScanOperator::has_output() const { // Can pick up more morsels or submit more tasks if (!_morsel_queue->empty()) { - return true; + auto status_or_is_ready = _morsel_queue->ready_for_next(); + if (status_or_is_ready.ok() && status_or_is_ready.value()) { + return true; + } } for (int i = 0; i < _io_tasks_per_scan_operator; ++i) { std::shared_lock guard(_task_mutex);